• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in JavaScript by
Q:
In JavaScript, what is the use of the prompt box?

1 Answer

0 votes
by
The prompt box in JavaScript helps the user to input with the help of a text box. The prompt() method helps to display the dialog box which prompts the visitor to provide an input.

Q42. What outcome will come out of this code:

var Y = 1;

if (function F(){})

{

y += Typeof F;</span>

}

console.log(y);

1undefined will be the output. This is because the if condition statement will evaluate using ‘eval’ and hence, eval(function f(){}) will return function f(){} (true). So, inside this if statement, one would execute the typeof f which will return undefined since the if statement code is executed at run time. Thus, the statement present inside the if condition is going to be evaluated during the run time.

Related questions

0 votes
asked Jun 28, 2020 in Python by Robindeniel
+1 vote
asked Dec 4, 2019 in JavaScript by SakshiSharma
...