Skip to content

JavaScript Quiz (50 Questions)

Answer all questions, track your progress live, and see your final JavaScript quiz score at the end.

Progress 0 / 50 answered
Q1. What is JavaScript mainly used for?
Q2. Which keyword declares a block-scoped variable?
Q3. Which keyword declares a constant variable?
Q4. Which data type represents true or false?
Q5. Which value means a variable has been declared but not assigned?
Q6. Which value represents an intentional empty value?
Q7. Which operator checks both value and type?
Q8. Which operator is used for logical AND?
Q9. Which operator is used for logical OR?
Q10. Which method prints output to the browser console?
Q11. Which method converts a JSON string into a JavaScript object?
Q12. Which method converts a JavaScript object into a JSON string?
Q13. Which array method transforms every item and returns a new array?
Q14. Which array method returns only matching items?
Q15. Which array method combines values into one result?
Q16. Which array method adds an item to the end?
Q17. Which array method removes the last item?
Q18. Which array method checks if a value exists?
Q19. Which string method removes whitespace from both ends?
Q20. Which string method converts text to uppercase?
Q21. What is a function?
Q22. Which syntax creates an arrow function?
Q23. What is a callback function?
Q24. What is closure?
Q25. What is hoisting?
Q26. Which keyword is affected by function scope and hoisting confusion?
Q27. What is the DOM?
Q28. Which method selects the first matching CSS selector?
Q29. Which method selects all matching CSS selectors?
Q30. Which property safely updates plain text?
Q31. Which property can create security risks with untrusted input?
Q32. Which method adds an event listener?
Q33. Which event happens when a form is submitted?
Q34. Which method stops default browser behavior?
Q35. What is event bubbling?
Q36. What is event delegation?
Q37. What does this refer to in an object method?
Q38. Do arrow functions create their own this?
Q39. What is a Promise?
Q40. Which Promise method handles success?
Q41. Which Promise method handles errors?
Q42. Which keyword declares an async function?
Q43. Which keyword waits for a Promise inside an async function?
Q44. Which API is used to make HTTP requests?
Q45. Which browser storage persists after the browser is reopened?
Q46. Which browser storage clears when the tab is closed?
Q47. Which function runs code once after a delay?
Q48. Which function runs code repeatedly?
Q49. Which method is preferred for smooth browser animations?
Q50. Which security issue is caused by injecting unsafe scripts?