JavaScript Flashcards
Developer uses the code below to format a date.
const date = new date (2020, 05, 10);
const dateDisplayOptions = {
year: ‘Numeric’,
month: ‘long’,
day: ‘numeric’
};
const formateddate = date.toLocalDateString(‘en’, datedisplayoptions);
After executing, what is the value of formattedDate?
A. May 10, 2020
B. June 10, 2020
C. October 05, 2020
D. November 05, 2020
A
function changeValue(param){
param = 5;
}
let a = 10;
let b = a;
changevalue(b);
const result = a + ‘ - ‘ + b;
What is the value of result when the code executes?
A . 10-10
B . 5-5
C . 10-5
D . 5-10
A
A 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 turnaround 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 latency
period?
A . NODE_DEBUG=true node server.js
B . DEBUG=http, https node server.js
C . NODE_DEBUG=http,https node server.js
D . DEBUG=true node server.js
D
A Developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three number in the array, The test passes:
Let res = sum2([1, 2, 3 ]) ;
console.assert(res === 6 );
Res = sum3([ 1, 2, 3, 4]);
console.assert(res=== 6);
A different developer made changes to the behavior of sum3 to instead sum all of the numbers present in the array. The test passes:
Which two results occur when running the test on the updated sum3 function ?
Choose 2 answers
A . The line 05 assertion passes.
B . The line 02 assertion passes.
C . The line 02 assertion fails.
D . The line 05 assertion fails.
B, D
Universal Containers (UC) just launched a new landing page, but users complain that the website is
slow. A developer found some functions any that might cause this problem. To verify this, the
developer decides to execute everything and log the time each of these three suspicious functions
consumes.
Which function can the developer use to obtain the time spent by every one of the three functions?
console.time(‘Preformance’);
maybeAHeavyFunction();
thisCouldTakeTooLong();
orMAybeThisOne();
console.endtime(‘Preformnce’);
A . console. timeLog ()
B . console.timeStamp ()
C . console.trace()
D . console.getTime ()
A
A test has a dependency on database. query. During the test, the dependency is replaced with an
object called database with the method,
Calculator query, that returns an array. The developer does not need to verify how many times the
method has been called.
Which two test approaches describe the requirement?
Choose 2 answers
A . White box
B . Stubbing
C . Black box
D . Substitution
A,D
Given the following code:
01 let x = null;
02 console.log(typeof x);
is the output of line 02?
A . ‘‘x’’
B . ‘‘null’’’
C . ‘‘object’’
D . ‘‘undefined’’
C
Which statement parses successfully?
A . JSON. parse (‘‘foo’’);
B . JSON.parse (‘‘foo’’);
C . JSON.parse (‘foo’);
D . JSON.parse (‘foo’);
A
A 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?
A . setTimeout (formatName(), 5000, ‘John’, ‘BDoe’);
B . setTimeout (formatName(‘John’, ‘‘Doe’), 5000);
C . setTimout(() => { formatName(‘John’, ‘Doe’) }, 5000);
D . setTimeout (‘formatName’, 5000, ‘John’, ‘Doe’);
D
Which two console logs output NaN?
Choose 2 answers | |
A . console.log(10 / Number(‘5) ) ;
B . console.log(parseInt ‘ (‘two’)) ;
C . console.log(10 / 0);
D . console.loeg(10 / ‘five’);
Answer: B, D
A developer wants to use a module named universalContainersLib and then call functions from it.
How should a developer import every function from the module and then call the functions foo and
bar?
A . import * from ‘/path/universalContainersLib.js’; universalContainersLib. foo ()7
universalContainersLib.bar ();
B . import {foo,bar} from ‘/path/universalCcontainersLib.js’; foo(): bar()?
C . import all from ‘/path/universalContainersLib.js’; universalContainersLib.foo();
universalContainersLib.bar ();
D . import * as lib from ‘/path/universalContainersLib.js’; lib.foo(); lib. bar ();
D
A developer wants to define a function log to be used a few times on a single-file JavaScript script.
01 // Line 1 replacement
02 console.log(‘‘LOG:’, logInput);
03 }
Which two options can correctly replace line 01 and declare the function for use?
Choose 2 answers
A . function leg(logInput) {
B . const log(loginInput) {
C . const log = (logInput) => {
D . function log = (logInput) {
Answer: A, C
Refer to the expression below:
Let x = (‘1’ + 2) == (6 * 2);
How should this expression be modified to ensure that evaluates to false?
A . Let x = (‘1’ + ‘ 2’) == ( 6 * 2);
B . Let x = (‘1’ + 2) == ( 6 * 2);
C . Let x = (1 + 2) == ( ‘6’ / 2);
D . Let x = (1 + 2 ) == ( 6 / 2);
Answer B
A developer implements and calls the following code when an application state change occurs:
Const onStateChange =innerPageState) => {
window.history.pushState(newPageState, ‘ ‘, null);
}
If the back button is clicked after this method is executed, what can a developer expect?
A . A navigate event is fired with a state property that details the previous application state.
B . The page is navigated away from and the previous page in the browser’s history is loaded.
C . The page reloads and all Javascript is reinitialized.
D . A popstate event is fired with a state property that details the application’s last state.
Answer: B
Refer to code below:
console.log(0);
setTimeout(() => (
console.log(1);
});
console.log(2);
setTimeout(() => {
console.log(3);
), 0);
console.log(4);
In which sequence will the numbers be logged?
A . 01234
B . 02431
C . 02413
D . 13024
C
Refer to code below:
Const objBook = {
Title: ‘Javascript’,
};
Object.preventExtensions(objBook);
Const newObjBook = objBook;
newObjectBook.author = ‘Robert’;
What are the values of objBook and newObjBook respectively ?
A . [title: ‘‘javaScript’’] [title: ‘‘javaScript’’]
B . {author: ‘‘Robert’’, title: ‘‘javaScript} Undefined
C . {author: ‘‘Robert’’, title: ‘‘javaScript} {author: ‘‘Robert’’, title: ‘‘javaScript}
D . {author: ‘‘Robert’’} {author: ‘‘Robert’’, title: ‘‘javaScript}
Answer: A
Refer to the following array:
Let arr = [ 1,2, 3, 4, 5];
Which three options result in x evaluating as [3, 4, 5] ?
Choose 3 answers.
A . Let x= arr.filter (( a) => (a<2));
B . Let x= arr.splice(2,3);
C . Let x= arr.slice(2);
D . Let x= arr.filter((a) => ( return a>2 ));
E . Let x = arr.slice(2,3);
Answer: B, C, D
In the browser, the window object is often used to assign variables that require the broadest scope in
an application Node.js application does not have access to the window object by default.
Which two methods are used to address this ?
A . Use the document object instead of the window object.
B . Assign variables to the global object.
C . Create a new window object in the root file.
D . Assign variables to module.exports and require them as needed.
B
Refer to the code below:
Const myFunction = arr => {
Return arr.reduce((result, current) =>{
Return result = current;
}, 10};
}
What is the output of this function when called with an empty array?
A . Returns 0
B . Throws an error
C . Returns 10
D . Returns NaN
Answer: C
Which three browser-specific APIs are available for developers to persist data between page loads ?
Choose 3 answers
A . IIFEs
B . indexedDB
C . Global variables
D . Cookies
E . localStorage.
Answer: A, B, E
A developer has two ways to write a function:
Option A:
function Monster() {
This.growl = () => {
Console.log (‘‘Grr!’’);
}
}
Option B:
function Monster() {};
Monster.prototype.growl =() => {
console.log(‘‘Grr!’’);
}
After deciding on an option, the developer creates 1000 monster objects.
How many growl methods are created with Option A Option B?
A . 1 growl method is created for Option A. 1000 growl methods are created for Option B.
B . 1000 growl method is created for Option A. 1 growl methods are created for Option B.
C . 1000 growl methods are created regardless of which option is used.
D . 1 growl method is created regardless of which option is used.
B
Given the code below:
Setcurrent URL ();
console.log(‘The current URL is: ‘ +url );
function setCurrentUrl() {
Url = window.location.href:
What happens when the code executes?
A . The url variable has local scope and line 02 throws an error.
B . The url variable has global scope and line 02 executes correctly.
C . The url variable has global scope and line 02 throws an error.
D . The url variable has local scope and line 02 executes correctly.
B
Refer to the code below:
let o = {
get js() {
let city1 = String(‘st. Louis’);
let city2 = String(‘ New York’);
return {
firstCity: city1.toLowerCase(),
secondCity: city2.toLowerCase(),
}
}
}
What value can a developer expect when referencing o.js.secondCity?
A . Undefined
B . ‘ new york ‘
C . ‘ New York ‘
D . An error
B
Why would a developer specify a package.jason as a developed forge instead of a dependency ?
A . It is required by the application in production.
B . It is only needed for local development and testing.
C . Other required packages depend on it for development.
D . It should be bundled when the package is published.
B
Refer to the code below:
Const searchTest = ‘Yay! Salesforce is amazing!’’ ;
Let result1 = searchText.search(/sales/i);
Let result 21 = searchText.search(/sales/i);
console.log(result1);
console.log(result2);
After running this code, which result is displayed on the console?
A . > true > false
B . > 5 >undefined
C . > 5 > -1
D . > 5 > 0
Answer: B
Refer to the code below:
Const resolveAfterMilliseconds = (ms) => Promise.resolve (
setTimeout (( => console.log(ms), ms ));
Const aPromise = await resolveAfterMilliseconds(500);
Const bPromise = await resolveAfterMilliseconds(500);
Await aPromise, wait bPromise;
What is the result of running line 05?
A . aPromise and bPromise run sequentially.
B . Neither aPromise or bPromise runs.
C . aPromise and bPromise run in parallel.
D . Only aPromise runs.
B
Refer to the following code that performs a basic mathematical operation on a provided
input:
function calculate(num) {
Return (num +10) / 3;
}
How should line 02 be written to ensure that x evaluates to 6 in the line below?
Let x = calculate (8);
A . Return Number((num +10) /3 );
B . Return (Number (num +10 ) / 3;
C . Return Integer(num +10) /3;
D . Return Number(num + 10) / 3;
B
Refer to the code below:
function changeValue(param) {
Param =5;
}
Let a =10;
Let b =5;
changeValue(b);
Const result = a+ ‘’ - ‘’+ b;
What is the value of result when code executes?
A . 10 -10
B . 5 -5
C . 5 - 10
D . 10 - 5
A
A developer implements a function that adds a few values.
Function sum(num) {
If (num == undefined) {
Num =0;
}
Return function( num2, num3){
If (num3 === undefined) {
Num3 =0 ;
}
Return num + num2 + num3;
}
}
Which three options can the developer invoke for this function to get a return value of 10 ?
Choose 3 answers
A . Sum () (20)
B . Sum (5, 5) ()
C . sum() (5, 5)
D . sum(5)(5)
E . sum(10) ()
Answer: C, D
The developer wants to test this code:
Const toNumber =(strOrNum) => strOrNum;
Which two tests are most accurate for this code?
Choose 2 answers
A . console.assert(toNumber(‘2’) === 2);
B . console.assert(Number.isNaN(toNumber()));
C . console.assert(toNumber(‘-3’) < 0);
D . console.assert(toNumber () === NaN);
Answer: A, C
A developer creates a simple webpage with an input field. When a user enters text in the input field
and clicks the button, the actual value of the field must be displayed in the console.
Here is the HTML file content:
Display The developer wrote the javascript code below:
Const button = document.querySelector(‘button’);
button.addEvenListener(‘click’, () => (
Const input = document.querySelector(‘input’);
console.log(input.getAttribute(‘value’));
When the user clicks the button, the output is always ‘‘Hello’’.
What needs to be done to make this code work as expected?
A . Replace line 04 with console.log(input .value);
B . Replace line 03 with const input = document.getElementByName(‘input’);
C . Replace line 02 with button.addCallback(‘‘click’’, function() {
D . Replace line 02 with button.addEventListener(‘‘onclick’’, function() {
Answer: A
What are two unique features of functions defined with a fat arrow as compared to normal function
definition?
Choose 2 answers
A . The function generated its own this making it useful for separating the function’s scope from its
enclosing scope.
B . The function receives an argument that is always in scope, called parentThis, which is the enclosing
lexical scope.
C . If the function has a single expression in the function body, the expression will be evaluated and
implicit returned.
D . The function uses the this from the enclosing scope.
Answer: A, C
A developer wants to leverage a module to print a price in pretty format, and has imported a method
as shown below:
Import printPrice from ‘/path/PricePrettyPrint.js’;
Based on the code, what must be true about the printPrice function of the PricePrettyPrint module for
this import to work ?
A . printPrice must be be a named export
B . printPrice must be an all export
C . printPrice must be the default export
D . printPrice must be a multi exportc
Answer: C
Refer to HTML below:
The current status of an Order: <span> In Progress </span>
Which JavaScript statement changes the text ‘In Progress’ to ‘Completed’ ?
A . document.getElementById(‘‘status’’).Value = ‘Completed’;
B . document.getElementById(‘‘#status’’).innerHTML = ‘Completed’ ;
C . document.getElementById(‘‘status’’).innerHTML = ‘Completed’ ;
D . document.getElementById(‘‘.status’’).innerHTML = ‘Completed’ ;
Answer: C
Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++)
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of array after the code executes?
A . [1, 2, 3, 4, 5, 4, 4]
B . [1, 2, 3, 4, 4, 5, 4]
C . [1, 2, 3, 5]
D . [1, 2, 3, 4, 5, 4]
D
A developer is setting up a new Node.js server with a client library that is built using events and
callbacks.
The library:
Will establish a web socket connection and handle receipt of messages to the server
Will be imported with require, and made available with a variable called we.
The developer also wants to add error logging if a connection fails.
Given this info, which code segment shows the correct way to set up a client with two events that listen
at execution time?
A . ws.connect (( ) => { console.log(‘connected to client’); }).catch((error) => { console.log(‘ERROR’ ,
error); }};
B . ws.on (‘connect’, ( ) => { console.log(‘connected to client’); ws.on(‘error’, (error) => {
console.log(‘ERROR’ , error); }); });
C . ws.on (‘connect’, ( ) => { console.log(‘connected to client’); }}; ws.on(‘error’, (error) => {
console.log(‘ERROR’ , error); }};
D . try{ ws.connect (( ) => { console.log(‘connected to client’); }); } catch(error) { console.log(‘ERROR’ ,
error); }; }
C
Refer to code below:
Let productSKU = ‘8675309’ ;
A developer has a requirement to generate SKU numbers that are always 19 characters lon,
starting with ‘sku’, and padded with zeros.
Which statement assigns the values sku0000000008675309 ?
A . productSKU = productSKU .padStart (19. ‘0’).padstart(‘sku’);
B . productSKU = productSKU .padEnd (16. ‘0’).padstart(‘sku’);
C . productSKU = productSKU .padEnd (16. ‘0’).padstart(19, ‘sku’);
D . productSKU = productSKU .padStart (16. ‘0’).padstart(19, ‘sku’);
D
Refer to the code below:
Let foodMenu1 = [‘pizza’, ‘burger’, ‘French fries’];
Let finalMenu = foodMenu1;
finalMenu.push(‘Garlic bread’);
What is the value of foodMenu1 after the code executes?
A . [ ‘pizza’,’Burger’, ‘French fires’, ‘Garlic bread’]
B . [ ‘pizza’,’Burger’, ‘French fires’]
C . [ ‘Garlic bread’ , ‘pizza’,’Burger’, ‘French fires’ ]
D . [ ‘Garlic bread’]
A
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
latency period?
A . DEBUG = http, https node server.js
B . NODE_DEBUG =http, https node server.js
C . DEBUG =true node server.js
D . NODE_DEBUG =true node server.js
Answer: C
Refer to the code below:
Let inArray =[ [ 1, 2 ] , [ 3, 4, 5 ] ];
Which two statements result in the array [1, 2, 3, 4, 5] ?
Choose 2 answers
A . [ ]. Concat.apply ([ ], inArray);
B . [ ]. Concat (… inArray);
C . [ ]. concat.apply(inArray, [ ]);
D . [ ]. concat ( [ ….inArray ] );
A,B
Refer to the code below:
let timeFunction =() => {
console.log(‘Timer called.’’);
};
let timerId = setTimeout (timedFunction, 1000);
Which statement allows a developer to cancel the scheduled timed function?
A . removeTimeout(timedFunction);
B . removeTimeout(timerId);
C . clearTimeout(timerId);
D . clearTimeout(timedFunction);
Answer: C
Refer to code below:
Let a =’a’;
Let b;
// b = a;
console.log(b);
What is displayed when the code executes?
A . ReferenceError: b is not defined
B . A
C . Undefined
D . Null
Answer: C
Which option is true about the strict mode in imported modules?
A . Add the statement use non-strict, before any other statements in the module to enable not-strict
mode.
B . You can only reference notStrict() functions from the imported module.
C . Imported modules are in strict mode whether you declare them as such or not.
D . Add the statement use strict =false; before any other statements in the module to enable not- strict
mode.
Answer: B
Refer to the code below:
Click me!
function printMessage(event) {
console.log(‘Row log’);
}
Let elem = document.getElementById(‘row1’);
elem.addEventListener(‘click’, printMessage, false);
Which code change should be made for the console to log only Row log when ‘Click me! ‘ is
clicked?
A . Add.event.stopPropagation(); to window.onLoad event handler.
B . Add event.stopPropagation(); to printMessage function.
C . Add event.removeEventListener(); to window.onLoad event handler.
D . Add event.removeEventListener(); toprintMessage function.
Answer: B
Refer to following code block:
Let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,];
Let output =0;
For (let num of array){
if (output >0){
Break;
}
if(num % 2 == 0){
Continue;
}
Output +=num;
What is the value of output after the code executes?
A . 16
B . 36
C . 11
D . 25
A
Which javascript methods can be used to serialize an object into a string and deserialize
a JSON string into an object, respectively?
A . JSON.stringify and JSON.parse
B . JSON.serialize and JSON.deserialize
C . JSON.encode and JSON.decode
D . JSON.parse and JSON.deserialize
A
Refer to code below:
Let first = ‘who’;
Let second = ‘what’;
Try{
Try{
Throw new error(‘Sad trombone’);
}catch (err){
First =’Why’;
}finally {
Second =’when’;
} catch (err) {
Second =’Where’;
}
What are the values for first and second once the code executes ?
A . First is Who and second is When
B . First is why and second is where
C . First is who and second is where
D . First is why and second is when
Answer: D
Teams at Universal Containers (UC) work on multiple JavaScript projects at the same time.
UC is thinking about reusability and how each team can benefit from the work of others.
Going open-source or public is not an option at this time.
Which option is available to UC with npm?
A . Private packages can be scored, and scopes can be associated to a private registries.
B . Private registries are not supported by npm, but packages can be installed via URL.
C . Private packages are not supported, but they can use another package manager like yarn.
D . Private registries are not supported by npm, but packages can be installed via git.
A
Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++){
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of the array after the code executes?
A . [1, 2, 3, 4, 5, 4, 4]
B . [1, 2, 3, 4, 4, 5, 4]
C . [1, 2, 3, 4, 5, 4]
D . [1, 2, 3, 5]
Answer: C
Which option is a core Node,js module?
A . Path
B . Ios
C . Memory
D . locate
Answer: A
Refer to following code:
class Vehicle {
constructor(plate) {
This.plate =plate;
}
}
Class Truck extends Vehicle {
constructor(plate, weight) {
//Missing code
This.weight = weight;
}
displayWeight() {
console.log(‘The truck ${this.plate} has a weight of ${this.weight} lb.’);}}
Let myTruck = new Truck(‘123AB’, 5000);
myTruck.displayWeight();
Which statement should be added to line 09 for the code to display ‘The truck 123AB has a
weight of 5000lb.’?
A . Super.plate =plate;
B . super(plate);
C . This.plate =plate;
D . Vehicle.plate = plate;
Answer: B
Refer to the following object:
const cat ={
firstName: ‘Fancy’,
lastName: ‘ Whiskers’,
Get fullName() {
return this.firstName + ‘ ‘ + this.lastName;
}
};
How can a developer access the fullName property for cat?
A . cat.fullName
B . cat.fullName()
C . cat.get.fullName
D . cat.function.fullName()
Answer: A
Universal Containers (UC) notices that its application that allows users to search for
accounts makes a network request each time a key is pressed. This results in too many
requests for the server to handle.
Address this problem, UC decides to implement a debounce function on string change
handler.
What are three key steps to implement this debounce function?
Choose 3 answers:
A . If there is an existing setTimeout and the search string change, allow the existing setTimeout to
finish, and do not enqueue a new setTimeout.
B . When the search string changes, enqueue the request within a setTimeout.
C . Ensure that the network request has the property debounce set to true.
D . If there is an existing setTimeout and the search string changes, cancel the existing setTimeout using
the persisted timerId and replace it with a new setTimeout.
E . Store the timeId of the setTimeout last enqueued by the search string change handle.
Answer: A, B, C
Refer to code below:
function Person() {
this.firstName = ‘John’;
}
Person.prototype ={
Job: x => ‘Developer’
};
const myFather = new Person();
const result =myFather.firstName + ‘ ‘ + myFather.job();
What is the value of the result after line 10 executes?
A . Error: myFather.job is not a function
B . Undefined Developer
C . John undefined
D . John Developer
Answer: D
A developer is wondering whether to use, Promise.then or Promise.catch, especially
when a Promise throws an error?
Which two promises are rejected?
Which 2 are correct?
A . Promise.reject(‘cool error here’).then(error => console.error(error));
B . Promise.reject(‘cool error here’).catch(error => console.error(error));
C . New Promise((resolve, reject) => (throw ‘cool error here’}).catch(error => console.error(error)) ;
D . New Promise(() => (throw ‘cool error here’}).then(null, error => console.error(error)));
Answer: B, C
developer is trying to convince management that their team will benefit from using
Node.js for a backend server that they are going to create. The server will be a web server that
handles API requests from a website that the team has already built using HTML, CSS, and
JavaScript.
Which three benefits of Node.js can the developer use to persuade their manager?
Choose 3 answers:
A . I nstalls with its own package manager to install and manage third-party libraries.
B . Ensures stability with one major release every few years.
C . Performs a static analysis on code before execution to look for runtime errors.
D . Executes server-side JavaScript code to avoid learning a new language.
E . User non blocking functionality for performant request handling .
Answer: A, C, E
Refer to HTML below:
Which expression outputs the screen width of the element with the ID card-01?
A . document.getElementById(‘ card-01 ‘).getBoundingClientRest().width
B . document.getElementById(‘ card-01 ‘).style.width
C . document.getElementById(‘ card-01 ‘).width
D . document.getElementById(‘ card-01 ‘).innerHTML.lenght*e
Answer: A
Refer to the code below:
console.log(‘‘start);
Promise.resolve(‘Success’) .then(function(value){
console.log(‘Success’);
});
console.log(‘End’);
What is the output after the code executes successfully?
A . End Start Success
B . Start Success End
C . Start End Success
D . Success Start End
C
Universal Container(UC) just launched a new landing page, but users complain that the
website is slow. A developer found some functions that cause this problem. To verify this, the
developer decides to do everything and log the time each of these three suspicious functions
consumes.
console.time(‘Performance’);
maybeAHeavyFunction();
thisCouldTakeTooLong();
orMaybeThisOne();
console.endTime(‘Performance’);
Which function can the developer use to obtain the time spent by every one of the three
functions?
A . console.timeLog()
B . console.getTime()
C . console.trace()
D . console.timeStamp()
A
Given 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 page is clicked?
A . Event.clicked
B . e.nodeTarget ==this
C . event.target.nodeName == ‘BUTTON’
D . button.addEventListener(‘click’)
C