LinkedIn Assessments - JavaScript 2019-2020
- ~15 minutes duration
- 70th percentile required to pass and get a badge
- Retry in 3 months if you don’t pass
You've written the event listener shown below for a form button, but each time you click the button, the page reloads. Which statement would stop this from happening?
button.addEventListener('click', function(e) { button.className = 'clicked'; }, false);- e.preventDefault();
<p class="pull">Lorem Ipsum </p> - document.querySelector(".pull");
let rate = 100;let modal = document.querySelector('#results'); setTimeout(function() { modal.classList.remove('hidden'); }, 10000); console.log('Results shown');- Immediately
- var student = new Person();
- When you want your code to choose between multiple options.
- A for statement is generic but a forEach statement can be used only with an array.
addTax(50);var Storm = function () {}; Storm.prototype.precip = 'rain'; var WinterStorm = function () {}; WinterStorm.prototype = new Storm(); WinterStorm.prototype.precip = 'snow'; var bob = new WinterStorm(); console.log(bob.precip);- 'snow'
- It returns a reference to a variable in its parent scope.
"use strict"; function logThis() { this.desc="logger"; console.log(this); } new logThis();- Function
console.log(typeof(42));- 'Number'
- !==
- A for statement is generic, but a forEach statement can be used only with an array
let rate = 100;var student = new Person();roadTypes[2]- target
JSON.parse()- When you want your code to choose between multiple options
for(var i=0; i<5; i++){ console.log(i); }- 01234
- Generator