Skip to content

1D0-735 CIW JavaScript Specialist Practice Questions

Prepare for 1D0-735 with more than an answer.

150 questions in the full set12 sample questionsUpdated Mar 12, 2026
Exam fee
$175 USD
Level
Specialist
Valid for
3 years (effective October 1, 2024)
Domains covered on the exam 4
  1. Essential JavaScript Principles and Practices25%
  2. Intermediate JavaScript Programming Techniques35%
  3. Applied JavaScript21%
  4. JavaScript Technology Extensions19%
  1. 1

    True or False: In JavaScript, declaring a variable with var inside a block (e.g., inside an if statement) limits its scope to that block.

    Show answer details

    Correct answer: B

    var is function-scoped, not block-scoped. If declared inside an if block, it is still accessible outside that block but within the containing function (or globally if not in a function). let and const are block-scoped.

  2. 2

    When using the typeof operator on a variable containing the value null, what string is returned?

    Show answer details

    Correct answer: B

    This is a historical bug in JavaScript. typeof null returns "object", even though null is a primitive value. It is important to check for null explicitly (e.g., value === null) rather than relying on typeof.

  3. 3

    Which JavaScript feature allows a function to access variables from an outer function that has already returned?

    Show answer details

    Correct answer: D

    A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). This gives you access to an outer function's scope from an inner function, even after the outer function has finished executing.

  4. 4

    A developer is refactoring a legacy JavaScript application to use modern ES6 syntax. The original code uses var for variable declaration inside a for loop, causing scope leakage. Which variable declaration keyword should be used to ensure the loop counter is block-scoped and not accessible outside the loop?

    Show answer details

    Correct answer: D

    The let keyword declares a block-scoped local variable. Using let in a for loop ensures that the variable is only available within the loop block. var is function-scoped, and const cannot be used for a loop counter that needs to be incremented.

  5. 5

    You are writing a function that processes user input. The input is received as a string '42', but you need to perform strict mathematical addition with another number, not concatenation. Which operator or function is best suited to convert this string to a number while preserving decimal precision if present?

    Show answer details

    Correct answer: D

    parseFloat() parses a string argument and returns a floating-point number. Unlike parseInt(), which truncates decimals, parseFloat() preserves them, making it the best choice for general numeric conversion where precision matters.

  6. 6

    Analyze the following code snippet. What will be the value of result after execution?

    var x = 10;
    var y = '5';
    var result = (x > 5) && (y === 5) ? 'Pass' : 'Fail';
    
    Show answer details

    Correct answer: B

    The expression evaluates as follows: (x > 5) is true. (y === 5) uses strict equality. Since y is a string '5' and 5 is a number, this is false. true && false results in false. The ternary operator returns the second value, 'Fail'.

Create an account to continue.