JavaScript-Developer-I Exam Question 56

A developer is setting up a Node.js server and is creating a script at the root of the source code, index.js, that will start the server when executed. The developer declares a variable that needs the folder location that the code executes from.
Which global variable can be used in the script?
  • JavaScript-Developer-I Exam Question 57

    Given the code:
    01 function GameConsole(name) {
    02 this.name = name;
    03 }
    04
    05 GameConsole.prototype.load = function(gamename) {
    06 console.log( ' ${this.name} is loading a game: ${gamename}.... ' );
    07 }
    08
    09 function Console16bit(name) {
    10 GameConsole.call(this, name);
    11 }
    12
    13 Console16bit.prototype = Object.create(GameConsole.prototype);
    14
    15 // insert code here
    16 console.log( ' ${this.name} is loading a cartridge game: ${gamename}.... ' );
    17 }
    18
    19 const console16bit = new Console16bit( ' SNEGeneziz ' );
    20 console16bit.load( ' Super Monic 3x Force ' );
    What should a developer insert at line 15?
  • JavaScript-Developer-I Exam Question 58

    Refer to the code below:
    const searchText = ' Yay! Salesforce is amazing! ' ;
    let result1 = searchText.search(/sales/i);
    let result2 = searchText.search(/sales/);
    console.log(result1);
    console.log(result2);
    After running this code, which result is displayed on the console?
  • JavaScript-Developer-I Exam Question 59

    Refer to the code below:
    01 function changeValue(param) {
    02 param = 5;
    03 }
    04 let a = 10;
    05 let b = a;
    06
    07 changeValue(b);
    08 const result = a + ' - ' + b;
    What is the value of result when the code executes?
  • JavaScript-Developer-I Exam Question 60

    Which actions can be done using the JavaScript browser console?