5. Technical Skills
Basic Javascript — Quiz
Test your understanding of basic javascript with 5 practice questions.
Practice Questions
Question 1
Which of the following is the correct way to access the first element of an array named 'myArray' in JavaScript?
Question 2
What will be the output of the following code?
let x = '10';
let y = 5;
let result = x + y;
console.log(result);
let x = '10';
let y = 5;
let result = x + y;
console.log(result);
Question 3
Which of the following is the correct way to create a new paragraph element in JavaScript and add it to the DOM?
Question 4
What will be the value of 'result' after the following code executes?
let result = 20;
result /= 4;
result += 3;
console.log(result);
let result = 20;
result /= 4;
result += 3;
console.log(result);
Question 5
Which of the following is the correct way to handle a button click event in JavaScript, assuming the button has the ID 'myButton'?
