JS Common
JS Common
JS Common
2. Given 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 ?
4. Developer removes the HTML class attribute from the checkout button, so
now it is simply:
`
5. Refer to the code below:
7. 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 =true node server.js
B. NODE_DEBUG =http, https node server.js
C. NODE_DEBUG =true node server.js
D. DEBUG = http, https node server.js
`
8. 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.
`
10. Given the following code:
12.
`
13.
`
15.
16. ----
`
17. -----------------------------
18. ---------------------------
`
19. _________________
`
21. ------------------
`
22. P______
`
23. _____
`
24.
25.
`
26. __
27. _____
28. Which three actions can be done using the JavaScript browser console?
Choose 3 answers
`
Considering that JavaScript is single-threaded, what is the output after code
executes?
A. 10
B. 11
C. 12
D. 13
32. The developer has a function that prints “Hello” to an input name. To test
this, the developer created a function that returns "World". However, the
following snippet does not print "Hello World”.
What can the developer do to change the code to print "Hello World’
`
A developer needs to dispatch a custom event called update to send information
about recordid.
Which two options could a developer insert at the placeholder in line 02 to
achieve this?
Choose 2 answers
34. 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 numbers in the
array. The test passes:
`
35. Refer to the code below
36. At Universal Containers, every team has its own way of copying JavaScript
objects. The code snippet shows animplementation from one team:
`
37. Refer to the code snippet:
38. myArray, can have one level, two levels, or more levels.
Which statement flattens myArray when it can be arbitrarily nested?
40. A developer sets up a Node.js server and creates a script at the root of the
source code, index.js, that starts the server when executed. The developer
`
declares a variable that needs the location and name of the file that the
code executes from.
Which global variable should be used in the script?
42. 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.
`
43. Refer to the code below
`
45. A developer wants to create a simple image upload in the browser using
the File API. The HTML is below:
`
46. Refer to the following code that imports a module named Utils:
`
47. Refer to the code below
`
50. Refer to the HTML below:
`
52. Refer to the code below
53. A developer removes the HTML class attribute from the checkout button,
so now it is simply:
`
54. Given the code below:
`
55. Refer to the code below
`
57. A developer wants to leverage a module to print a price in pretty format,
and has imported a method as shown below:
`
60. Which two options are code Node.js module:
`
63. Refer the code below:
`
66. A developer needs to debug a Node.js web server because a runtime error
keeps occurring at one of the endpoints. The developer wants to test the
endpoint on a local machine and make the request against a local server to
look at the behavior. In the source code, the server.js file will start the
server. The developer wants to debug the Node.js server only using the
terminal.
Here I choiced A
67. A developer has code that calculates a restaurant bill, but generates
incorrect answers while testing the code.
`
68. Refer the code below:
`
71.
`
74.
75. A developer implements and calls the following code when an application
state change occurs:
`
77. A developer wants to use a try...catch statement to catch any error that
countSheep () may throw and pass it to handelError() function
`
78. A developer wants to define a function log to be used a few times om
single-file JavaScript script.
79.
`
80.
81.
Here I choiced C
`
82. to
83.
`
85.
86.
`
87.
88.
`
89.
90.
`
91.
92.
`
93.
94.
`
95.
96.
97.
`
98.
99.
`
100.
101.
`
проверить
102.
103.
104.
`
105.
`
106.
`
107.
108.
109.
`
110. fd
`
111.
112.
`
113.
114.
`
115.
116.
`
117.
HERE the answer is correct , B
`
118.
`
119.
`
120.
121.
проверить
`
122.
123.