Web Tools Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu
Apu February 19, 2023 › #Javascript #Q&A

Which of the following is the correct output for the following JavaScript code?

  1. A) 1
  2. B) true
  3. C) undefined
  4. D) 0
<script>
 let myStr; 
 console.log(myStr);
</script>

If you run the above code, the output will be "undefined", which is option C) in the multiple choice question.

Explanation: The variable myStr is declared but not initialized, so its value is undefined.

save
listen
AI Answer
Write Your Answer
loading
back
View All