Free Certified JavaScript Developer I Exam Braindumps
Salesforce Certified JavaScript Developer I Questions 86–90 (page: 19)

Updated On: 10-Feb-2026

Refer to thefollowing code that imports a module named utils:
import (foo, bar) from `/path/Utils.js';
foo() ;
bar() ;
Which two implementations of Utils.js export foo and bar such that the code above runs without error?
Choose 2 answers

  1. // FooUtils.js and BarUtils.js existImport (foo) from `/path/FooUtils.js';Import (boo) from ` /path/NarUtils.js';
  2. const foo = () => { return `foo' ; }const bar = () => { return `bar' ; }export { bar, foo }
  3. Export default class {foo() { return `foo' ; }bar() { return `bar' ; }}
  4. const foo = () => { return `foo';}const bar = () => {return `bar'; }Export default foo, bar;

Answer(s): B,C



developer creates a new web server that uses Node.js. It imports a server library that uses events and callbacks for handling server functionality. The server library is imported with require and is made available to the code by a variable named server. The developer wants to log any issues that the server has while booting up.
Given the code and the information thedeveloper has, which code logs an error at boost with an event?

  1. Server.catch ((server) => {console.log(`ERROR', error);});
  2. Server.error ((server) => {console.log(`ERROR', error);});
  3. Server.on (`error', (error) => {console.log(`ERROR', error);});
  4. Try{server.start();} catch(error) {console.log(`ERROR', error);}

Answer(s): C



Refer to the following code:
function test (val) {
If (val === undefined) {
return `Undefined values!' ;
}
if (val === null) {
return `Null value! ';
}
return val;
}
Let x;
test(x);
What is returned by the function call on line 13?

  1. Undefined
  2. Line 13 throws an error.
  3. `Undefined values!'
  4. `Null value!'

Answer(s): C



Which code statement below correctly persists an objects inlocal Storage ?

  1. const setLocalStorage = (storageKey, jsObject) => {window.localStorage.setItem(storageKey, JSON.stringify(jsObject));}
  2. const setLocalStorage = ( jsObject) => {window.localStorage.connectObject(jsObject));}
  3. const setLocalStorage= ( jsObject) => {window.localStorage.setItem(jsObject);}
  4. const setLocalStorage = (storageKey, jsObject) => {window.localStorage.persist(storageKey, jsObject);}

Answer(s): A



Given the code below:
const copy = JSON.stringify([ newString(` false '), new Bollean( false ), undefined ]); What is the value of copy?

  1. -- [ \"false\" , { } ]--
  2. -- [ false, { } ]--
  3. -- [ \"false\" , false, undefined ]--
  4. -- [ \"false\" ,false, null ]--

Answer(s): D



Viewing page 19 of 46
Viewing questions 91 - 95 out of 224 questions


Post your Comments and Discuss Salesforce Certified JavaScript Developer I exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!