|
|
|
|
|
by jacquesm
4155 days ago
|
|
Suggested minor change to the non_fp one: var inList = [1,2,3,4,5,6,7,8,9,10];
var non_fp = function ( myListOfNumbers ) {
var out = [];
// square the numbers
for (var i = 0; i < myListOfNumbers.length; i++) {
var x = myListOfNumbers[i] * myListOfNumbers[i];
if (x > 10 && x < 100) {
out.push( x );
}
}
return out;
}
|
|
You see the point I'm driving at, though?
(and thanks for prodding me into writing code to illustrate things better)