Examine the following code: What will appear on the console as a result?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:3 mins read

Examine the following code: let car = {make: "Citroen", model: "DS"}; for (let f in car) console.log(f); What will appear on the console as a result? "Citroen" "DS"  "make: Citroen"…

Continue ReadingExamine the following code: What will appear on the console as a result?

Examine the following code: How many times will “test” be displayed in the console as a result of its execution?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:2 mins read

Examine the following code: for (let a = 4; a < 4; a++) {    console.log("test"); } How many times will "test" be displayed in the console as a result of…

Continue ReadingExamine the following code: How many times will “test” be displayed in the console as a result of its execution?

Examine the following code: Which statement can replace the for from the example above? 

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:2 mins read

Examine the following code: for (let a = 5; a > 1; a--) {    console.log(a); } ; Which statement can replace the for from the example above? let a =…

Continue ReadingExamine the following code: Which statement can replace the for from the example above? 

We store an array of animal names in the animals variable (e.g. let animals = [“dog”, “cat”, “hamster”, “rabbit”];). Which of the following statements will display exactly two names from the array?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:2 mins read

We store an array of animal names in the animals variable (e.g. let animals = ["dog", "cat", "hamster", "rabbit"];). Which of the following statements will display exactly two names from the array? for (let i…

Continue ReadingWe store an array of animal names in the animals variable (e.g. let animals = [“dog”, “cat”, “hamster”, “rabbit”];). Which of the following statements will display exactly two names from the array?

Analyze the following code: How many times will “hello” be displayed in the console as a result of its execution?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:2 mins read

Analyze the following code: for (let x = 10; x > 1; x -= 2) console.log("hello"); How many times will "hello" be displayed in the console as a result of…

Continue ReadingAnalyze the following code: How many times will “hello” be displayed in the console as a result of its execution?

Analyze the following code: Which statement can replace the do … while from the example above?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:2 mins read

Analyze the following code: let a = 10; do {    console.log(a--); } while (a > 3); Which statement can replace the do ... while from the example above? while (a > 4)     …

Continue ReadingAnalyze the following code: Which statement can replace the do … while from the example above?

If we want to display all the elements of the days array in reverse order (starting from the last element) then we can do this using the statement:

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:2 mins read

If we want to display all the elements of the days array in reverse order (starting from the last element) then we can do this using the statement: for(let i =…

Continue ReadingIf we want to display all the elements of the days array in reverse order (starting from the last element) then we can do this using the statement:

Which of the following loop instructions is intended only to loop through all the keys of the indicated object?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:1 mins read

Which of the following loop instructions is intended only to loop through all the keys of the indicated object? for ... of  if ... else  for ... in  do ...…

Continue ReadingWhich of the following loop instructions is intended only to loop through all the keys of the indicated object?

Analyze the code below: How can we write the same condition using the switch statement?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:2 mins read

Analyze the code below: if (counter === 10) {    console.log("abc"); } How can we write the same condition using the switch statement? case(counter) {   switch 10:      console.log("abc") }; switch(counter)…

Continue ReadingAnalyze the code below: How can we write the same condition using the switch statement?

Review the following code snippet: What values can the counter and show variables have so that the console displays “test” as a result of code execution?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:2 mins read

Review the following code snippet: if (counter <= 10 && show === false) {    console.log("test"); } What values can the counter and show variables have so that the console displays "test" as a result…

Continue ReadingReview the following code snippet: What values can the counter and show variables have so that the console displays “test” as a result of code execution?

Review the following code: What will be displayed in the console as a result of its execution?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:6 mins read

Review the following code: let x = 100; if (x < 100)    x = 20; console.log(x) What will be displayed in the console as a result of its execution? nothing 100 …

Continue ReadingReview the following code: What will be displayed in the console as a result of its execution?

Which of the following operators is a ternary one?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:1 mins read

Which of the following operators is a ternary one? An assignment operator =. A conditional operator ? :. A typeof operator. An increment operator ++. Explanation & Hint: The ternary operator in JavaScript is represented by the ? and : symbols. It is…

Continue ReadingWhich of the following operators is a ternary one?

We want to rewrite the following code snippet using the conditional operator:

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Post last modified:June 12, 2024
  • Reading time:2 mins read

We want to rewrite the following code snippet using the conditional operator: let name; if (test) {    name = "Alice"; } else {    name = "Bob"; } Which notation is…

Continue ReadingWe want to rewrite the following code snippet using the conditional operator: