What is the difference between JavaScript Engine and JavaScript Runtime Environment

后端 未结 4 2045
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 09:18

I\'m feeling a bit confused, could someone help to describe What is the difference between JavaScript Engine and JavaScript Runtime Environment. BTW, Event Loop was impleme

4条回答
  •  庸人自扰
    2020-12-07 09:30

    Imagine a robot is playing a music:

    • The JavaScript code would be the music notes to the robot.
    • TheJavaScript engine would be the robot which can understand the notes and act on it.
    • The JavaScript runtime would be the instruments the robot can use in order to play the music.

    Imagine a robot is putting out a fire:

    • The JavaScript code would be the instructions to the robot to put out a fire.
    • The JavaScript engine would be the robot which can understand the instructions and act on it.
    • The JavaScript runtime would be the fire truck, and the water gun.

提交回复
热议问题