linkedin-skill-assessments-quizzes

JavaScript

Assessment link(linkedin)

Q1. Which operator returns true if the two compared values are not equal?

Reference Javascript Comparison Operators

Q2. How is a forEach statement different from a for statement?

Reference Differences between forEach and for loop

Q3. Review the code below. Which statement calls the addTax function and passes 50 as an argument?

function addTax(total) {
  return total * 1.05;
}

Reference functions in javascript

Q4. Which statement is the correct way to create a variable called rate and assign it the value 100?

Reference Javascript Assignment operators

Q5. Which statement creates a new object using the Person constructor? Which statement creates a new Person object called “student”?

Reference

Q6. When would the final statement in the code shown be logged to the console? When would ‘results shown’ be logged to the console?

let modal = document.querySelector('#result');
setTimeout(function () {
  modal.classList.remove('hidden');
}, 10000);
console.log('Results shown');

Reference Javascript is synchronous and single threaded

Q7. Which snippet could you add to this code to print “food” to the console?

class Animal {
  static belly = [];
  eat() {
    Animal.belly.push('food');
  }
}
let a = new Animal();
a.eat();
console.log(/* Snippet Here */); //Prints food

Reference Javascript Class static Keyword

Q8. You’ve written the code shown to log a set of consecutive values, but it instead results in the value 5, 5, 5, and 5 being logged to the console. Which revised version of the code would result in the value 1, 2, 3 and 4 being logged?

for (var i = 1; i <= 4; i++) {
  setTimeout(function () {
    console.log(i);
  }, i * 10000);
}
for (var i = 1; i <= 4; i++) {
  (function (i) {
    setTimeout(function () {
      console.log(j);
    }, j * 1000);
  })(j);
}
for (var i = 1; i <= 4; i++) {
  setTimeout(function () {
    console.log(i);
  }, i * 1000);
}
for (var i = 1; i <= 4; i++) {
  (function (j) {
    setTimeout(function () {
      console.log(j);
    }, j * 1000);
  })(i);
}
for (var j = 1; j <= 4; j++) {
  setTimeout(function () {
    console.log(j);
  }, j * 1000);
}
  1. Reference setTimeout
  2. Reference immediately invoked anonymous functions

Q9. How does a function create a closure?

Reference

Q10. Which statement creates a new function called discountPrice?

let discountPrice = function (price) {
  return price * 0.85;
};
let discountPrice(price) {
  return price * 0.85;
};
let function = discountPrice(price) {
  return price * 0.85;
};
discountPrice = function (price) {
  return price * 0.85;
};

Reference defining javascript functions

Q11. What is the result in the console of running the code shown?

var Storm = function () {};
Storm.prototype.precip = 'rain';
var WinterStorm = function () {};
WinterStorm.prototype = new Storm();
WinterStorm.prototype.precip = 'snow';
var bob = new WinterStorm();
console.log(bob.precip);

Reference prototype chain

Q12. You need to match a time value such as 12:00:32. Which of the following regular expressions would work for your code?

NOTE: The first three are all partially correct and will match digits, but the second option is the most correct because it will only match 2 digit time values (12:00:32). The first option would have worked if the repetitions range looked like [0-9]{2}, however because of the comma [0-9]{2,} it will select 2 or more digits (120:000:321). The third option will any range of time digits, single and multiple (meaning 1:2:3 will also match).

More resources:

  1. Repeating characters
  2. Kleene operators

Q13. What is the result in the console of running this code?

'use strict';
function logThis() {
  this.desc = 'logger';
  console.log(this);
}
new logThis();

Reference javascript classes

Q14. How would you reference the text ‘avenue’ in the code shown?

let roadTypes = ['street', 'road', 'avenue', 'circle'];

Reference accessing javascript arrays

Q15. What is the result of running this statement?

console.log(typeof 42);

Reference javascript data types

Q16. Which property references the DOM object that dispatched an event?

Reference DOM events

Q17. You’re adding error handling to the code shown. Which code would you include within the if statement to specify an error message?

function addNumbers(x, y) {
  if (isNaN(x) || isNaN(y)) {
  }
}

Reference javascript throw

Q18. Which method converts JSON data to a JavaScript object?

Reference convert json to javascript object

Q19. When would you use a conditional statement?

Reference javascript conditionals

Q20. What would be the result in the console of running this code?

for (var i = 0; i < 5; i++) {
  console.log(i);
}

Reference javascript for loops

Q21. Which Object method returns an iterable that can be used to iterate over the properties of an object?

Reference javascript object static methods

Q22. What will be logged to the console?

var a = ['dog', 'cat', 'hen'];
a[100] = 'fox';
console.log(a.length);

Q23. What is one difference between collections created with Map and collections created with Object?

Explanation: Map.prototype.size returns the number of elements in a Map, whereas Object does not have a built-in method to return its size. Reference map methods javascript

Q24. What is the value of dessert.type after executing this code?

const dessert = { type: 'pie' };
dessert.type = 'pudding';

Reference working with js objects

Q25. 0 && hi

Reference boolean logic

Q26. Which of the following operators can be used to do a short-circuit evaluation?

Reference short circuit javascript

Q27. Which statement sets the Person constructor as the parent of the Student constructor in the prototype chain?

Reference prototype object js

Q28. Why would you include a “use strict” statement in a JavaScript file?

Reference what is use strict in js

Q29. Which Variable-defining keyword allows its variable to be accessed (as undefined) before the line that defines it?

Reference var vs let vs const in js

Q30. Which of the following values is not a Boolean false?

Reference boolean of a string

Q31. Which of the following is not a keyword in JavaScript?

Reference js reserved words

Q32. Which variable is an implicit parameter for every function in JavaScript?

Reference implicit js parameters for functions

Q33. For the following class, how do you get the value of 42 from an instance of X?

class X {
  get Y() {
    return 42;
  }
}
var x = new X();

Reference getters

Q34. What is the result of running this code?

sum(10, 20);
diff(10, 20);
function sum(x, y) {
  return x + y;
}

let diff = function (x, y) {
  return x - y;
};

Reference accessing before initialization

Q35. Why is it usually better to work with Objects instead of Arrays to store a collection of records?

Reference efficiency of lookups Explanation: Records in an object can be retrieved using their key which can be any given value (e.g. an employee ID, a city name, etc), whereas to retrieve a record from an array we need to know its index.

Q36. Which statement is true about the “async” attribute for the HTML script tag?

Reference async attribute for html

Q37. How do you import the lodash library making it top-level Api available as the “_” variable?

Reference how to import library in js

Q38. What does the following expression evaluate to?

[] == [];

Reference arrays in js are objects

Q39. What type of function can have its execution suspended and then resumed at a later point?

Reference what are generators in nodejs

Q40. What will this code print?

var v = 1;
var f1 = function () {
  console.log(v);
};

var f2 = function () {
  var v = 2;
  f1();
};

f2();

Reference closures in js \/ nested functions

Q41. Which statement is true about Functional Programming?

Reference functional programming

Q42. Your code is producing the error: TypeError: Cannot read property ‘reduce’ of undefined. What does that mean?

Explanation: You cannot invoke reduce on undefined object... It will throw (yourObject is not Defined...)

Q43. How many prototype objects are in the chain for the following array?

let arr = [];

Reference array prototype

Q44. Which choice is not a unary operator?

Reference js unary operators

Q45. What type of scope does the end variable have in the code shown?

var start = 1;
if (start === 1) {
  let end = 2;
}

Reference block vs function scope

Q46. What will the value of y be in this code:

const x = 6 % 2;
const y = x ? 'One' : 'Two';

Reference ternary operator js

Q47. Which keyword is used to create an error?

Reference throwing errors in js

Q48. What’s one difference between the async and defer attributes of the HTML script tag?

Reference async vs defer

Q49. The following program has a problem. What is it?

var a;
var b = (a = 3) ? true : false;

Reference ternary operator js

Q50. Which statement references the DOM node created by the code shown?

<p class="pull">lorem ipsum</p>

Reference query selector

Q51. What value does this code return?

let answer = true;
if (answer === false) {
  return 0;
} else {
  return 10;
}

Reference javascript conditionals

Q52. What is the result in the console of running the code shown?

var start = 1;
function setEnd() {
  var end = 10;
}
setEnd();
console.log(end);

Reference

Q53. What will this code log in the console?

function sayHello() {
  console.log('hello');
}

console.log(sayHello.prototype);

Reference prototypes

Q54. Which collection object allows unique value to be inserted only once?

Reference javascript sets

Q55. What two values will this code print?

function printA() {
  console.log(answer);
  var answer = 1;
}
printA();
printA();

Reference

Q56. How does the forEach() method differ from a for statement?

Reference Differences between forEach and for loop

Q57. Which choice is an incorrect way to define an arrow function that returns an empty object?

Reference arrow functions

Q58. Why might you choose to make your code asynchronous?

EXPLANATION: "to ensure that tasks further down in your code are not initiated until earlier tasks have completed" you use the normal (synchronous) flow where each command is executed sequentially. Asynchronous code allows you to break this sequence: start a long running function (AJAX call to an external service) and continue running the rest of the code in parallel.

Q59. Which expression evaluates to true?

  1. Reference booleans
  2. Reference 2 - booleans

Q60. Which of these is a valid variable name?

Reference coding conventions

Q61. Which method cancels event default behavior?

Reference javascript events

Q62. Which method do you use to attach one DOM node to another?

Reference Node interface

Q63. What statement can be used to skip an iteration in a loop?

Reference break vs continue

Q64. Which choice is a valid example for an arrow function?

Reference arrow functions

Q65. Which concept is defined as a template that can be used to generate different objects that share some shape and/or behavior?

Reference javascript classes

Q66. How do you add a comment to JavaScript code?

Reference comments in javascript

Q67. If you attempt to call a value as a function but the value is not a function, what kind of error would you get?

Reference javascript errors

Q68. Which method is called automatically when an object is initialized?

Reference javascript constructors

Q69. What is the result of running the statement shown?

let a = 5;
console.log(++a);

Reference ++x vs x++

Q70. You’ve written the event listener shown below for a form button, but each time you click the button, the page reloads. Which statement would stop this from happening?

button.addEventListener(
  'click',
  function (e) {
    button.className = 'clicked';
  },
  false,
);

Reference events in javascript

Q71. Which statement represents the starting code converted to an IIFE?

Reference what is an Immediately Invoked Function Expression

Q72. Which statement selects all img elements in the DOM tree?

Reference query selector

Q73. Why would you choose an asynchronous structure for your code?

Reference async function

Q74. What is the HTTP verb to request the contents of an existing resource?

Reference http methods

Q75. Which event is fired on a text field within a form when a user tabs to it, or clicks or touches it?

Reference javascript events

Q76. What is the result in the console of running this code?

function logThis() {
  console.log(this);
}
logThis();

Reference what is the javascript window

Q77. Which class-based component is equivalent to this function component?

const Greeting = ({ name }) => <h1>Hello {name}!</h1>;

Q79. What is the output of this code?

var obj;
console.log(obj);

Reference working with objects

Q80. How would you use the TaxCalculator to determine the amount of tax on $50?

class TaxCalculator {
  static calculate(total) {
    return total * 0.05;
  }
}

Reference functions in javascript

Q81. What is wrong with this code?

const foo = {
  bar() {
    console.log('Hello, world!');
  },
  name: 'Albert',
  age: 26,
};
  1. Reference functions in javascript
  2. Reference working with objects

Q82. What will be logged to the console?

console.log('I');
setTimeout(() => {
  console.log('love');
}, 0);
console.log('Javascript!');
I
Javascript!
love
love
I
Javascript!
I
love
Javascript!

Reference https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#reasons_for_delays_longer_than_specified especially see the ‘late timeouts’ section.

Q83. What will this code log to the console?

const foo = [1, 2, 3];
const [n] = foo;
console.log(n);

Reference array deconstruction

Q84. How do you remove the property name from this object?

const foo = {
  name: 'Albert',
};

Reference working with objects

Q85. What is the difference between the map() and the forEach() methods on the Array prototype?

  1. Reference map
  2. Reference Differences between forEach and for loop

Q86. Which concept does this code illustrate?

function makeAdder(x) {
  return function (y) {
    return x + y;
  };
}

var addFive = makeAdder(5);
console.log(addFive(3));

Reference currying

Q87. Which tag pair is used in HTML to embed JavaScript?

Reference add js to html file

Q88. If your app receives data from a third-party API, which HTTP response header must the server specify to allow exceptions to the same-origin policy?

Reference Cross-Origin Resource Sharing

Q89. What is the output of this code?

let rainForests = ['Amazon', 'Borneo', 'Cerrado', 'Congo'];
rainForests.splice(0, 2);
console.log(rainForests);

Reference array methods

Q90. Which missing line would allow you to create five variables(one,two,three,four,five) that correspond to their numerical values (1,2,3,4,5)?

const numbers = [1, 2, 3, 4, 5];
//MISSING LINE

Reference array destructuring

Q91. What will this code print?

const obj = {
  a: 1,
  b: 2,
  c: 3,
};

const obj2 = {
  ...obj,
  a: 0,
};

console.log(obj2.a, obj2.b);

Reference spread syntax es6

Q92. Which line could you add to this code to print “jaguar” to the console?

let animals = ['jaguar', 'eagle'];
//Missing Line
console.log(animals.pop()); //Prints jaguar

Reference Javascript Array pop()

shift() - removes the FIRST element of an array and returns the removed item.

pop() - removes the LAST element of an array and returns the removed item.

reverse() - reverses the order of the elements in an array.

filter() - get every element in the array that meets the condition.

Q93. What line is missing from this code?

//Missing Line
for (var i = 0; i < vowels.length; i++) {
  console.log(vowels[i]);
  //Each letter printed on a separate line as follows;
  //a
  //e
  //i
  //o
  //u
}

Reference working with arrays

Q94. What will be logged to the console?

const x = 6 % 2;
const y = x ? 'One' : 'Two';
console.log(y);

Note: this question is same with Q46. Reference ternary operator js

Q95. How would you access the word It from this multidimensional array?

let matrix = [["You","Can"],["Do","It"],["!","!","!"]];

Q96. What does this code do?

const animals = ['Rabbit', 'Dog', 'Cat'];
animals.unshift('Lizard');

Reference working with arrays

Q97. What is the output of this code?

let x = 6 + 3 + '3';
console.log(x);

Reference type coercion

Q98. Which statement can take a single expression as input and then look through a number of choices until one that matches that value is found?

Reference switch

Q99. Which statement prints “roar” to the console?

var sound = 'grunt';
var bear = { sound: 'roar' };
function roar() {
  console.log(this.sound);
}
  1. Reference Apply
  2. Reference this
  3. Reference bind

Q100. Which choice is a valid example of an arrow function, assuming c is defined in the outer scope?

Reference arrow functions

Q101. Which statement correctly imports this code from some-file.js?

//some-file.js
export const printMe = (str) => console.log(str);

Reference importing libraries in javascript

Q102. What will be the output of this code?

const arr1 = [2, 4, 6];
const arr2 = [3, 5, 7];

console.log([...arr1, ...arr2]);

Reference spread syntax

Q103. Which method call is chained to handle a successful response returned by fetch()?

Reference fetch

Q104. Which choice is not an array method?

Reference working with arrays

Q105. Which JavaScript loop ensures that at least a singular iteration will happen?

Reference loops in js

Q106. What will be logged to the console?

console.log(typeof 'blueberry');

Reference what is typeof

Q107. What is the output that is printed when the div containing the text “Click Here” is clicked?

//HTML Markup
<div id="A">
  <div id="B">
    <div id="C">Click Here</div>
  </div>
</div>
//JavaScript
document.querySelectorAll('div').forEach((e) => {
  e.onclick = (e) => console.log(e.currentTarget.id);
});
  1. Reference query selector
  2. Reference events

Q108. What will this code log to the console?

const myNumbers = [1, 2, 3, 4, 5, 6, 7];
const myFunction = (arr) => {
  return arr.map((x) => x + 3).filter((x) => x < 7);
};
console.log(myFunction(myNumbers));

Reference functions in javascript

Q109. What does this code print to the console?

let rainForestAcres = 10;
let animals = 0;

while (rainForestAcres < 13 || animals <= 2) {
  rainForestAcres++;
  animals += 2;
}

console.log(animals);

Reference MDN JavaScript Looping code

Q110. Which snippet could you add to this code to print “YOU GOT THIS” to the console?

let cipherText = [...'YZOGUT QGMORTZ MTRHTILS'];
let plainText = '';

/* Missing Snippet */

console.log(plainText); //Prints YOU GOT THIS
for (let key of cipherText.keys()) {
  plainText += key % 2 === 0 ? key : ' ';
}
for (let [index, value] of cipherText.entries()) {
  plainText += index % 2 !== 0 ? value : '';
}
for (let [index, value] of cipherText.entries()) {
  plainText += index % 2 === 0 ? value : '';
}
for (let value of cipherText) {
  plainText += value;
}
  1. Reference MDN JavaScript Destructuring
  2. Reference MDN JavaScript Array entries
  3. Reference MDN JavaScript Remainder/Modulo

Q111. Which Pokemon will be logged to the console?

var pokedex = ['Snorlax', 'Jigglypuff', 'Charmander', 'Squirtle'];
pokedex.pop();
console.log(pokedex.pop());

Explanation: The pop() method removes the last element from an array and returns that element. This method changes the length of the array.

Reference Array.pop

Q112. Which statement can be used to select the element from the DOM containing the text “The LinkedIn Learning library has great JavaScript courses” from this markup?

<h1 class="content">LinkedIn Learning</h1>
<div class="content">
  <span class="content">The LinkedIn Learning library has great JavaScript courses!</span>
</div>

Q113. Which value is not falsey?

Reference Falsy

Q114. What line of code causes this code segment to throw an error?

const lion = 1;
let tiger = 2;
var bear;

++lion;
bear += lion + tiger;
tiger++;
  1. Reference const in js
  2. Reference TypeError: invalid assignment to const “x”

Q115. What will be the value of result after running this code?

const person = { name: 'Dave', age: 40, hairColor: 'blue' };
const result = Object.keys(person).map((x) => x.toUpperCase());
  1. Reference Object.keys()
  2. Reference Array.prototype.map()
  3. Reference String.prototype.toUpperCase()

Q116. Which snippet could you insert to this code to print “swim” to the console?

let animals = ["eagle", "osprey", "salmon"];
let key = animal => animal === "salmon";

if(/* Insert Snippet Here */){
  console.log("swim");
}

Reference Array.prototype.some

Q117. What is the output of this code?

class RainForest {
  static minimumRainFall = 60;
}

let congo = new RainForest();
RainForest.minimumRainFall = 80;
console.log(congo.minimumRainFall);

Reference Classes static

Q118. How can you attempt to access the property a.b on obj without throwing an error if a is undefined?

let obj = {};

Reference Optional chaining (?.)

Q119. What happens when you run this code?

if (true) {
  var x = 5;
  const y = 6;
  let z = 7;
}
console.log(x + y + z);

Reference let statement

Q120. What does this code print to the console?

const x = [1, 2];
const y = [5, 7];
const z = [...x, ...y];
console.log(z);

Reference spread syntax (…)

Q121. Given this code, which statement will be evaluated as false?

const a = { x: 1 };
const b = { x: 1 };

Reference

Q122. What will this code log to the console?

console.log(typeof 41.1);

Reference

Q123. What is the output of this code?

let scores = [];
scores.push(1, 2);
scores.pop();
scores.push(3, 4);
scores.pop();
score = scores.reduce((a, b) => a + b);
console.log(score);
  1. Reference Array.prototype.push()
  2. Reference Array.prototype.pop()
  3. Reference Array.prototype.reduce()

Q124. What does this code print to the console?

let bear = {
  sound: 'roar',
  roar() {
    console.log(this.sound);
  },
};

bear.sound = 'grunt';
let bearSound = bear.roar;
bearSound();

Reference

Q125. What is the output of this code?

var cat = { name: 'Athena' };

function swap(feline) {
  feline.name = 'Wild';
  feline = { name: 'Tabby' };
}

swap(cat);
console.log(cat.name);

Q126. What will this code output to the log?

var thing;
let func = (str = 'no arg') => {
  console.log(str);
};
func(thing);
func(null);

Q127. What will this code print to the console?

const myFunc = () => {
  const a = 2;
  return () => console.log('a is ' + a);
};
const a = 1;
const test = myFunc();
test();

Q128. What will this code print to the console?

const myFunc = (num1, num2 = 2, num3 = 2) => {
  return num1 + num2 + num3;
};
let values = [1, 5];
const test = myFunc(2, ...values);
console.log(test);

Q129. Which code would you use to access the Irish flag?

var flagsJSON =
  '{ "countries" : [' +
  '{ "country":"Ireland" , "flag":"🇮🇪" },' +
  '{ "country":"Serbia" , "flag":"🇷🇸" },' +
  '{ "country":"Peru" , "flag":"🇵🇪" } ]}';

var flagDatabase = JSON.parse(flagsJSON);

Q130. Which snippet allows the acresOfRainForest variable to increase?

let conservation = true;
let deforestation = false;
let acresOfRainForest = 100;
if (/* Snipped goes here */){
    ++acresOfRainForest;
}

Q131. Which of these evaluate to true?

Q132. How would you add a data item named animal with a value of sloth to local storage for the current domain?

Reference

Q133. What value is printed to the console after this code execute?

let cat = Object.create({ type: 'lion' });
cat.size = 'large';

let copyCat = { ...cat };
cat.type = 'tiger';

console.log(copyCat.type, copyCat.size);

Reference

Q134. What does this code print to the console?

let animals = [{ type: 'lion' }, 'tiger'];
let clones = animals.slice();

clones[0].type = 'bear';
clones[1] = 'sheep';

console.log(animals[0].type, clones[0].type);
console.log(animals[1], clones[1]);

Reference

Q135. What will be the output of the following code?

a=5;
b=4;
alert(a++(+(+(+b))));

Q136. Which snippet could you add to this code to print “{“type”: “tiger”}” to the console?

let cat = { type: "tiger", size: "large" };

let json = /* Snippet here */;

console.log(json); // print {"type":"tiger"}

Reference

Q137. Which document method is not used to get a reference to a DOM node?

Reference

Q138. In JavaScript, all objects inherit a built-in property from a ****___****.

Reference

Q139. Which of the following are not server-side Javascript objects?

Reference

Q140. What will be the output of the following code snippet?

const obj1 = { first: 20, second: 30, first: 50 };
console.log(obj1);

Q141. Which object in Javascript doesn’t have a prototype?

Reference

Q142. What does … operator do in JS?

Q143. How to stop an interval timer in Javascript?

Reference

Q144. What will be the output of the following code snippet?

print(typeof NaN);

Q145. What will be the output of the following code snippet?

<script type="text/javascript">a = 5 + "9"; document.write(a);</script>

Q146. Which of the following methods can be used to display data in some form using Javascript?

Q147. What value is assigned to total after this code executes?

function sum(num1, num2 = 2, num3 = 3) {
  return num1 + num2 + num3;
}
let values = [1, 5];
let total = sum(4, ...values);

Reference: Rest parameters

Q148. Which statement is applicable to the defer attribute of the HTML

Reference: defer html script attribute

Q149. Which method of a class is called to initialize an object of that class?

Reference: constructor method

Q150. Which expression evaluates to true?

Reference: Boolean object

Q151. How would you check if the word “pot” is in the word “potato”?

Reference: String.prototype.includes()

Q152. Which collection object allows a unique value to be inserted only once?

Reference: developer.mozilla Set

Q153. How would you change the color of this header to pink?

<h2 id="cleverest">girls</h2>

Reference: W3Schools HTML DOM Style color Property

Q154. Which line is missing from this code if you expect the code to evaluate to true?

var compare = function (test1, test2) {
  // Missing line
};

compare(1078, '1078'); // yields true

Reference: MDN Equality Docs

Q155. What is the output of this code?

if (true) {
  var first = 'You';
}

function fScope() {
  var second = 'got this!';
}
fScope();
console.log(first);
console.log(second);

Reference: W3schools JS Scoping

Q156. What is the output for the code given below?

console.log('hello' + 'world' + '!');

Q157. What is the output of this code?

console.log(10 + 10);

Reference: GeeksForGeeks

Q159. How do you define a function in JavaScript?

Reference

Q160. Your code is producing the error: TypeError: Cannot read property ‘reduce’ of undefined. What does that mean?

Q161. Which of the following methods can be used to display data in some form using Javascript?

Q162. Which document method is not used to get a reference to a DOM node?

Q163. Which of these is a valid variable name?

Q164. What function is used in JavaScript to schedule a function to run after a specified number of milliseconds?

Reference

Q165. Which of the following is a server-side Java Script object?

Reference

Q166. Which statement best describes the var keyword’s scope in JavaScript?

Q167. What will be logged to the console?

const foo = () => console.log('First');
const bar = () => setTimeout(() => console.log('Second'), 0);
foo();
bar();
console.log('Third');

Q168. What will be the output of running this code?

function scream(words) {
  return words.toUpperCase() + '!!!';
}

scream('yay');