bconglet
9/11/2015 - 7:44 PM

Javascript Tests

Javascript Tests

Test 2

Code

(function code() { code = 123; console.log( code );}())

What it's logged when the code is executed?

function code() { code = 123; console.log( code );}()

Why?

Test 1

Code

var testArray = ['1','10','100','1000','10000', '100000', '1000000'].map(parseInt)

Anticipated Result

var testArray = [1, 10, 100, 1000, 10000, 100000, 100000];

Actual Result?

var result = [1, NaN, 4, 27, 256, 3125, 46656];

Why and how do you get the Anticipated Result?