10 questions · JavaScript · intermediate level
What is the output?
const [a, , b] = [1, 2, 3] console.log(a, b)
What does this output?
function sum(first, ...rest) {
return first + rest.reduce((a, b) => a + b, 0)
}
console.log(sum(1, 2, 3, 4))Spot the issue:
const name = "Rahul"
const msg = "Hello, ${name}!"
console.log(msg)