2.What will be printed in the console?

console.log(num);

num = 10;

console.log(num);

var num;

4 Likes

firstly it will print 0 and then it will print 10

answer of this question:10

1 Like

Correct answer of this question: undefined and 10

1 Like

firstvundefind and second 10

3 Likes

Hi everyone, thank you for participating!

Correct answer of this question: undefined and 10

Correct answer of this question: undefined and 10

@khssbhagavan1919 ,
Correct answer of this question: undefined and 10

Answer : undefined and 10

3 Likes

How can js compilation will do?

1 Like

Hi @kollidayakar77 ,
Basically, JS has no compilation step; instead, an interpreter in the browser reads the JS code, interprets each line, and runs it.

JS-Interpreter:
JS-Interpreter is a sandboxed JavaScript interpreter written in JavaScript. It allows for execution of arbitrary JavaScript code line by line. Execution is completely isolated from the main JavaScript environment.

Sandboxed JavaScript:
It is a simplified subset of the JavaScript language that provides a safe way to execute arbitrary JavaScript logic from Google Tag Manager’s custom templates.

1 Like