Ten quick questions on general programming — not Solidity, not blockchain. Solidity can’t be a first language, so this checks you have the footing track 4 assumes. It advises; it never locks.
After this runs, what is x? let x = 5
x = x + 3
x = x * 216 13 10 5
What does double(double(3)) return? function double(n) {
return n * 2
}6 12 9 3
What is printed? let n = 7
if (n % 2 === 0) {
print('even')
} else {
print('odd')
}even odd nothing 7
What is total after the loop? let total = 0
for (let i = 1; i <= 4; i++) {
total = total + i
}4 10 24 6
What is nums[1] after this? let nums = [10, 20, 30]
nums[1] = 9910 20 99 30
Arrays are zero-indexed. For [4, 8, 15, 16], what is the index of 15? 1 2 3 15
What does user.age evaluate to? let user = { name: 'Ada', age: 36 }'Ada' 36 undefined 2
What does the function return? function f() {
let a = 2
let b = a + 1
return b
}2 3 a + 1 nothing
What is the value of ready? let hasKey = true
let hasMoney = false
let ready = hasKey && hasMoneytrue false undefined
What is a[0] after this runs? let a = [1, 2, 3]
let b = a
b[0] = 100100 — b and a point to the same array 1 — b is a separate copy undefined