Posts

Javascript event-loop and Nodejs event-loop.

Image
The Event Loop in the Browser or Node is not part of V8. The Event Loop Is Part of a different application/dependency/library which is provided by the Browser or Node. They do not use V8's event loop. V8 does implement an event loop, it is there . However, it is meant to be overridden or replaced, which is something both Chrome and NodeJS happen to do. The Nodejs event loop implementation differs from the browser-based event loop one. While Nodejs uses the Google V8 as its runtime, it does not use V8 to implement the event loop. Nodejs uses the Libuv library (written in C) to implement the event loop.  Browser (Chrome):  V8 just executes your JavaScript (If and else statements, for statements, functions, arithmetic operations e.t.c) and then hands over operations to Libevent . In the Browser(e.g Chrome) apart from JavaScript Engine V8 (Chrome uses V8), the browser also contains different applications/dependencies/libraries which can do a variety of things like sending HTTP requests

LinkedIn JavaScript Skill Assessment 82 Questions.

Image
  Q1. Which operator returns true if the two compared values are not equal? <> ~ ==! !== Q2. How is a forEach statement different from a for a statement? Only a for statement uses a callback function. A for statement is generic, but a forEach statement can be used only with an array. Only a forEach statement lets you specify your own iterator. A forEach statement is generic, but a for statement can be used only with an array. Q3. Review the code below. Which statement calls the addTax function and passes 50 as an argument? function addTax(total) { return total * 1.05; } addTax = 50; return addTax 50; addTax(50); addTax 50; Q3. How would you use this function to find out how much tax should be paid on $50? (Version 2, possibly an updated version) function addTax(total) { return total * 1.05; } addTax($50); return addTax 50; addTax(50); addTax 50; Q4. Which statement is the correct way to create a variable called rate and assign it the value 100? let rate = 100; let 100 = rate; 100