HansR on the Web - All quiz questions on JavaScript
Updated: 14-03-2018 23:42:08h
topics: javascript|web workers, level: 100
What best describes a Web Worker?
Please select exactly one correct alternative.
Answer
A Web Worker is a JavaScript that runs in the background, independently of other scripts, without affecting the performance of the page. You can continue to do whatever you want: clicking, selecting things, etc., while the web worker runs in the background.
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user's browser. Taking advantage of cool new web technologies is great fun, until you have to support browsers that lag behind. Modernizr makes it easy for you to write conditional JavaScript and CSS to handle each situation, whether a browser supports a feature or not.
Both functions execute a given function in a given time. But setTimeout only executes this function once, while setInterval schedules a repeating execution.
Please select exactly one or more correct alternatives.
Answer
Please see the correct answer above.
Reading
No resources given.
topics: javascript|timing, level: 100
Why is it not recommended to have many setInterval / setTimeout at the same time?
Please select exactly one correct alternative.
Answer
They cost a lot of CPU time. This could make your browser slow. Ofcourse, this depends on the processing power of your machine. In general, mobile devices are slower than e.g. desktop devices. It is preferred that a single setInterval / setTimeout call manages multiple animations.