0

Javascript is an interpreted language which executes code line by line. On the other hand, AST (Abstract Syntax Tree) inside the Javascript engine, created the data structure of the whole code and converts into machine code. Then how line by line mechanism is being applied here?

phuzi
  • 12,078
  • 3
  • 26
  • 50
atq
  • 11
  • 3
  • Just to save time - https://www.geeksforgeeks.org/how-v8-compiles-javascript-code/ – phuzi May 04 '22 at 07:56
  • 1
    What makes you think it's interpreted line by line? – Barmar May 04 '22 at 08:09
  • @Barmar, Thank you for your response. from https://www.javatpoint.com/how-does-javascript-work I found below "JavaScript is an interpreted language that means it gets executed in line by line manner (or which means the JavaScript engine converts the Js code line by line and runs in the same manner instead of converting the whole program once)." – atq May 04 '22 at 08:18
  • 1
    It's more complicated than that. See the link @phuzi provided. – Barmar May 04 '22 at 14:03
  • The quoted sentence is just totally wrong. Which is not uncommon for that site. – rici May 04 '22 at 15:41

0 Answers0