LinkedIn Assessments - JavaScript 2019
- ~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'