Before track 4

Are you ready for code?

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 * 2
What does double(double(3)) return?
function double(n) {
  return n * 2
}
What is printed?
let n = 7
if (n % 2 === 0) {
  print('even')
} else {
  print('odd')
}
What is total after the loop?
let total = 0
for (let i = 1; i <= 4; i++) {
  total = total + i
}
What is nums[1] after this?
let nums = [10, 20, 30]
nums[1] = 99
Arrays are zero-indexed. For [4, 8, 15, 16], what is the index of 15?
What does user.age evaluate to?
let user = { name: 'Ada', age: 36 }
What does the function return?
function f() {
  let a = 2
  let b = a + 1
  return b
}
What is the value of ready?
let hasKey = true
let hasMoney = false
let ready = hasKey && hasMoney
What is a[0] after this runs?
let a = [1, 2, 3]
let b = a
b[0] = 100
0 of 10 answered