SALESFORCE JAVASCRIPT
DEVELOPER 1 EXAM STUDY
QUESTIONS AND ANSWERS
Prototype inheritance - ANSWER-an in memory object that defines the
properties and functions of other objects
JSON spec is based on - ANSWER-object literal notation
shift() - ANSWER-remove the first element and return that elemend
unshift() - ANSWER-Adds new elements to the beginning of an array, and
returns the new length
sort() - ANSWER-a-b is sort asc. and b-a is sort descending
var declaration is hoisted BUT - ANSWER-is undefined until assigned a value
Are function expressions hoisted (e.g. var s = function (){} - ANSWER-NO
Are function definitions hoisted (e.g. function s (){} - ANSWER-YES
What is not allowed in strict mode? - ANSWER-1) using a var without
declaring it.
2) deleting a var or object
3) duplicating a parameter name
Object.assign(target, source) - ANSWER-source copies and overwrites target
Classes in JavaScript (four things) - ANSWER-1) Are special functions which
are primarily syntactical sugar over prototype based inheritance
2) Two ways to define a class: class declaration, class expression
3) Class expressions can be named or unnamed
4) class declarations are NOT hoisted
jquery defines a function with ____ and Lodash with ______ - ANSWER-$ and __
What's true about var test = new function(){} - ANSWER-It inherits the global
scope even if called in a block
, What are two ways to access data in a converted JSON string? - ANSWER-
user.email and user[email]
Scope of variables declared without the var keyword - ANSWER-become
global no matter where it's declared
Object.freeze() - ANSWER-Freezes an object making it immutable.
Prevents adding new properties
Doesn't allow removing of existing properties
Doesn't allow you to change immediate properties of the object
Attributes of child objects can be modified
Object.seal() - ANSWER-seals an object
Allows changing existing properties of an object
Prevents adding new properties
Doesn't allow removing existing properties
What is true about const objB=objA? - ANSWER-They both now point to the
same address in the stack so if one changes, so does the other
popstate - ANSWER-when an event is dispatched to the window each time
the active history entry changes between to history entires for the same
document
navigate() - ANSWER-loads a specified URL
pushstate() - ANSWER-pushes given data onto the session history stack WITH
NO PAGE REFRESH
valid events with interacting with the browser - ANSWER-1) Contextmenu
2) mousedown
3) keyup
To persist an object in localStorage, you need to use - ANSWER-JSON.stringify
output the screen width of the element - ANSWER-
document.getElementById('id').style.width
select a specific <li> - ANSWER-document.querySelector('#main li:nth-
child(2)')
DEVELOPER 1 EXAM STUDY
QUESTIONS AND ANSWERS
Prototype inheritance - ANSWER-an in memory object that defines the
properties and functions of other objects
JSON spec is based on - ANSWER-object literal notation
shift() - ANSWER-remove the first element and return that elemend
unshift() - ANSWER-Adds new elements to the beginning of an array, and
returns the new length
sort() - ANSWER-a-b is sort asc. and b-a is sort descending
var declaration is hoisted BUT - ANSWER-is undefined until assigned a value
Are function expressions hoisted (e.g. var s = function (){} - ANSWER-NO
Are function definitions hoisted (e.g. function s (){} - ANSWER-YES
What is not allowed in strict mode? - ANSWER-1) using a var without
declaring it.
2) deleting a var or object
3) duplicating a parameter name
Object.assign(target, source) - ANSWER-source copies and overwrites target
Classes in JavaScript (four things) - ANSWER-1) Are special functions which
are primarily syntactical sugar over prototype based inheritance
2) Two ways to define a class: class declaration, class expression
3) Class expressions can be named or unnamed
4) class declarations are NOT hoisted
jquery defines a function with ____ and Lodash with ______ - ANSWER-$ and __
What's true about var test = new function(){} - ANSWER-It inherits the global
scope even if called in a block
, What are two ways to access data in a converted JSON string? - ANSWER-
user.email and user[email]
Scope of variables declared without the var keyword - ANSWER-become
global no matter where it's declared
Object.freeze() - ANSWER-Freezes an object making it immutable.
Prevents adding new properties
Doesn't allow removing of existing properties
Doesn't allow you to change immediate properties of the object
Attributes of child objects can be modified
Object.seal() - ANSWER-seals an object
Allows changing existing properties of an object
Prevents adding new properties
Doesn't allow removing existing properties
What is true about const objB=objA? - ANSWER-They both now point to the
same address in the stack so if one changes, so does the other
popstate - ANSWER-when an event is dispatched to the window each time
the active history entry changes between to history entires for the same
document
navigate() - ANSWER-loads a specified URL
pushstate() - ANSWER-pushes given data onto the session history stack WITH
NO PAGE REFRESH
valid events with interacting with the browser - ANSWER-1) Contextmenu
2) mousedown
3) keyup
To persist an object in localStorage, you need to use - ANSWER-JSON.stringify
output the screen width of the element - ANSWER-
document.getElementById('id').style.width
select a specific <li> - ANSWER-document.querySelector('#main li:nth-
child(2)')