Explore key concepts and features of asynchronous programming in…
Start QuizExplore underrated JavaScript libraries that offer powerful solutions for…
Start QuizExplore how pnpm 10 enhances package installation security and…
Start QuizExplore how JavaScript classes relate to prototypes, constructor functions,…
Start QuizDiscover the proven patterns and practical habits that distinguish…
Start QuizAssess your understanding of JavaScript modules, including import/export syntax,…
Start QuizChallenge your understanding of JavaScript function definitions, syntax, and…
Start QuizSharpen your understanding of JavaScript objects with these easy…
Start QuizExplore the basics of JavaScript loops with these straightforward…
Start QuizExplore easy questions covering fundamental JavaScript concepts, suitable for…
Start QuizExplore the basics of the JavaScript Event Loop, including…
Start QuizChallenge your JavaScript fundamentals with 15 essential interview questions…
Start QuizExplore essential concepts for handling dependencies across multi-package JavaScript…
Start QuizChallenge your understanding of fundamental JavaScript concepts with these…
Start QuizExplore the history and evolution of JavaScript, from its…
Start QuizEnhance your understanding of JavaScript with this beginner-friendly quiz…
Start QuizTest your understanding of common internet troubleshooting scenarios and…
Start QuizTest your knowledge of ES6 (ECMAScript 2015) features with…
Start QuizTest your understanding of key JavaScript topics with these…
Start QuizTest your knowledge with these commonly asked JavaScript interview…
Start QuizTest your knowledge of Observables in JavaScript, including their…
Start QuizTest your knowledge of essential JavaScript developer tips and…
Start QuizTest your knowledge of JavaScript ES6 features with this…
Start QuizTest your understanding of core JavaScript concepts relevant to…
Start QuizTest your expertise on advanced JavaScript topics including Regular Expressions, JSON, AJAX, Fetch API, Geolocation, Web Storage, and Canvas functionality. This quiz aims to assess your deep understanding through complex scenarios and code analysis.
This quiz contains 15 questions. Below is a complete reference of all questions, answer choices, and correct answers. You can use this section to review after taking the interactive quiz above.
Which regular expression will correctly match a string that starts with a digit, followed by exactly four lowercase letters and ends with a period?
Correct answer: ^\d[a-z]{4}\.$
Given a valid JSON string stored in the variable data, which method would you use in JavaScript to convert it into an object?
Correct answer: JSON.parse(data)
Which return type is produced by calling str.match(/(foo)(bar)/) where str is 'foobarfoo'?
Correct answer: Array with full match and capture groups
If you run JSON.stringify({name: 'Ana', greet: function() { return 'hi'; }}) in JavaScript, what will be the output?
Correct answer: {"name":"Ana"}
In an XMLHttpRequest, what is the value of readyState when the request has been sent but response is not yet available?
Correct answer: 2
When using fetch() in JavaScript, which statement correctly processes the response only if the server returns a successful status code?
Correct answer: if(response.ok) { /* handle success */ }
Which method of the Geolocation API is used to continuously receive location updates as the user's position changes?
Correct answer: watchPosition()
Approximately how much data (in megabytes) can you typically store per domain using localStorage in most modern web browsers?
Correct answer: 5 MB
What differentiates sessionStorage from localStorage in the Web Storage API?
Correct answer: sessionStorage data persists only for the duration of the page session
Which responseType property value should you set on XMLHttpRequest to handle binary image data as a Blob?
Correct answer: blob
What method draws a filled rectangle at position (30,50) with a width of 150 and height 40 on a canvas context ctx?
Correct answer: ctx.fillRect(30, 50, 150, 40)
When making a POST request with fetch to send JSON data, which header is essential to inform the server of the data format?
Correct answer: Content-Type: application/json
In regular expressions, which construct will match 'cat' only if it is not followed by 'fish'?
Correct answer: cat(?!fish)
How would you draw an image object img onto ctx at coordinates (0,0) with width 200 and height 100?
Correct answer: ctx.drawImage(img, 0, 0, 200, 100)
Which type of property will be omitted when using JSON.stringify on an object in JavaScript?
Correct answer: A function property