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

Quiz

JD1

Digir 159 questions

Take the quiz

Questions in this quiz (159)

  1. 1Given two expressions var1 and var2. What are two valid ways to return the logical AND of the two expressions and ensure it is data type Boolean?
    Choose 2 answers.
    1. ABoolean(var1 && var2)
    2. Bvar1 && var2
    3. Cvar1.toBoolean() && var2.toBoolean()
    4. DBoolean(var1) && Boolean(var2)
  2. 2Which option is true about the strict mode in imported modules?
    1. AAdd the statement use non-strict; before any other statements in the module to enable not-strict mode
    2. BA developer can only reference notStrict() functions from the imported module
    3. CImported modules are in strict mode whether you declare them as such or not
    4. DAdd the statement use strict = false; before any other statements in the module to enable not-strict mode
  3. 3A developer removes the HTML class attribute from the checkout button, so now it is simply:
    <button>Checkout</button>
    There is a test to verify the existence of the checkout button, however, it looks for a button with class = "blue". The test fails because no such button is found.
    Which type of test category describes this test?
    1. ATrue positive
    2. BTrue negative
    3. CFalse positive
    4. DFalse negative
  4. 4Refer to the code below:
    let textValue = '1984';
    Which code assignment shows a correct way to convert this string to an integer?
    1. Alet numberValue = Integer(textValue);
    2. Blet numberValue = textValue.toInteger();
    3. Clet numberValue = (Number) textValue;
    4. Dlet numberValue = Number(textValue);
  5. 5Refer to the code below:
    Const p1 = 3.1415926;
    What is the data type of p1?
    1. ADouble
    2. BNumber
    3. CFloat
    4. DDecimal
  6. 6Which two console logs output NaN?
    Choose 2 answers.
    1. Aconsole.log(10/0);
    2. Bconsole.log(10/'five');
    3. Cconsole.log(10/Number('5'));
    4. Dconsole.log(parseInt('two'));
  7. 7A developer has a web server running with Node.js. The command to start the web server is node server.js. The web server started having latency issues.
    Instead of a one second turn around for web requests, the developer now sees a five second turnaround.
    Which command can the web developer run to see what the module is doing during the atency peroid?
    1. ADEBUG = http, https node server.js
    2. BNODE_DEBUG = http, http node server.js
    3. CDEBUG = true node server.js
    4. DNODE_DEBUG = true node server.js
  8. 8A developer has a formatName function that takes two arguments, firstName and lastName, and returns a string. They want to schedule the function to run once after five seconds.
    What is the correct syntax to schedule this function?
    1. AsetTimeout(formatName, 5000, 'John', 'Doe')'
    2. BsetTimeout('formatName',5000, 'John', 'Doe')'
    3. CsetTimeout(formatName('John', 'Doe'), 5000)'
    4. DsetTimeout(() = > (formatName('John', 'Doe')), 5000);
  9. 9Given the JavaScript below:

    function filterDOM(searchString) {
    const parsedSearchString = searchString && searchString.toLowerCase();
    document.querySelectorAll('.account').forEach(account => (
    const accountName = account.innerHTML.toLowerCase();
    account.style.display = accountName.includes(parsedSearchString) ? /insert code here/;
    });
    }

    Which code should replace the placeholder comment on line 05 to hide accounts that do not match the search string?
    1. A'hidden' : 'visible'
    2. B'none' : 'block'
    3. C'block' : 'none'
    4. D'visible' : 'hidden'
  10. 10Given the following code:
    document.body.addEventListener('click', (event) => {
    if(/* CODE REPLACEMENT HERE */) {
    console.log('button clicked!');
    }
    });
    Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on the page is clicked?
    1. AEvent.clicked
    2. Be.nodeTarget == this
    3. Cevent.target.nodeName == 'BUTTON'
    4. Dbutton.addEventListener('click');

Information

Description
Quiz on JD1, created by Digir Digir on 04/02/2023.
Language
English
Views
39
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?