Click here to Skip to main content
15,867,488 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is JavaScript Compiled or just Interpreted.

In case it is just an Interpreted Language, it should not support feature like Hoisting, since feature of Hoisting is supported only if the execution Engine know about the Environment.

In case it just Interprets the Code, Environment Information would not be available

What I have tried:

Looking for the Theoretical aspect
Posted
Updated 13-Sep-16 23:22pm
v2
Comments
Richard MacCutchan 14-Sep-16 3:52am    
Google for "Javascript" and you will find all the information you need.

Javascript is an interpreted language - it is not compiled.
It always uses hoisting, which does not need to know about the environment, it just needs to read the source before it begins interpreting it, and "moves" declarations to the top of the containing scope so they can be used before they are declared.
JavaScript Hoisting[^]
Also see: JavaScript Scoping and Hoisting[^] which has a good explanation of JS scope and hoisting.
 
Share this answer
 
Comments
[no name] 14-Sep-16 5:32am    
Please look for my Query Posted as separate Solution below... Thanks for the reply, but please help me understand it further
V8 compiler in Google Chrome Compile the Code as per it official Documentation.

Is it talking about javascript code compilation or something else.

Introduction · v8/v8 Wiki · GitHub

Please look for the General Introduction of V8 Engine.

When the Engine itself compiles the code, how can javascript be interpretted.

Please help me with the confusion.

Regards,
Mayank Gupta
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900