GoConqr has a new look! Let us know what you think.

Quiz

Trudne JSDev1

Digir 22 questions Updated 19 Feb 2023

Take the quiz

Questions in this quiz (22)

  1. 1Refer to the code below:
    Which code change should be made for the console to log only Row log when 'Click me!' is clicked?
    Image for question 1
    1. AAdd event.removeEventListener(); to printMessage function
    2. BAdd event.removeEventListener(); to window.onLoad event handler
    3. CAdd event.stopPropagation(); to window.onLoad event handler
    4. DAdd event.stopPropagation(); to printMessage function
  2. 2Given the code below:
    What happens when the code executes?
    Image for question 2
    1. AThe url variable has a global scope and line 02 throws an error
    2. BThe url variable has local scope and line 02 throws an error
    3. CThe url variable has local scope and line 02 executes correctly
    4. DThe url variable has a global scope and line 02 executes correctly
  3. 3Refer to the code below:
    What is the output after the code executes?
    Image for question 3
    1. AReferenceError: eyeColor is not defined
    2. BReferenceError: assignment to undeclared variable "Person"
    3. Cundefined
    4. DDeveloper
  4. 4A developer is asked to fix some bugs reported by users. To do that, the developer adds a breakpoint for debugging.
    When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console?
    Choose 2 answers:
    Image for question 4
    1. AThe values of the carSpeed and fourWheels variables
    2. BThe style, event listeners and other attributes applied to the carSpeed DOM element
    3. CA variable displaying the number of instances created for the Car object
    4. DThe information stored in the window.localStorage property
  5. 5What are two unique features of functions defined with a fat arrow as compared to normal function definition?
    Choose 2 answers:
    1. AThe function generates its own this making it useful for separating the function's scope from its enclosing scope
    2. BThe function receives an argument that is always in scope, called parentThis, which is the enclosing lexical scope
    3. CIf the function has a single expression in the function body, the expression will be evaluated and implicitly returned
    4. DThe function uses the this from the enclosing scope
  6. 6A developer implements and calls the following code when an application state change occurs:
    If the back button is clicked after this method is executed, what can a developer expect?
    Image for question 6
    1. AA popstate event is fired with a state property that details the application's last state
    2. BA navigate event is fired with a state property that details the previous application state
    3. CThe page is navigated away from and the previous page in the browser's history is loaded
    4. DThe page reloads and all JavaScript is reinitialized
  7. 7Refer to the HTML below:
    <p> The current status of an Order: <span id="status">In Progress</span></p>
    Which JavaScript statement changes the text "In Progress" to "Completed"?
    1. Adocument.getElementById("status").Value = 'Completed';
    2. Bdocument.getElementById(".status").innerHTML = 'Completed';
    3. Cdocument.getElementById("status").innerHTML = 'Completed';
    4. Ddocument.getElementById("#status").innerHTML = 'Completed';
  8. 8Given the HTML below:
    Which statement adds the priority-account CSS class to the Universal Containers row?
    Image for question 8
    1. Adocument.querySelector('#row-uc').classList.add('priority-account');
    2. Bdocument.querySelector('#row-uc').classes.push('priority-account');
    3. Cdocument.getElementById('row-uc').addClass('priority-account');
    4. Ddocument.querySelectorAll('#row-uc').classList.add('priority-account');
  9. 9Given the code block below:
    What should a developer insert at line 15 to output the following message using the load method?
    SNEGeneziz is loading a cartidge game: Super Monic 3x Force...
    Image for question 9
    1. AConsole16bit.prototype.load(gamename) {
    2. BConsole16bit = Object.create(GameConsole.prototype).load = function(gamename) {
    3. CConsole16bit.prototype.load(gamename) = function() {
    4. DConsole16bit.prototype.load = function(gamename) {
  10. 10Refer to the following code that inports a module named Utils:
    Which two implementations of Utils.js export foo and bar such that the code above runs without error?
    Choose 2 answers.
    Image for question 10
    1. A/Image for option A
    2. B,Image for option B
    3. C.Image for option C
    4. D'Image for option D

Information

Description
Quiz on Trudne JSDev1, created by Digir Digir on 19/02/2023.
Language
English
Views
4
History
Created on 19 Feb 2023 · updated on 19 Feb 2023
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?