Answer the question
In order to leave comments, you need to log in
How to use the ability to change a running program?
Javascript allows you to make changes in a running program through the eval(code) function,
it is similar to Lisp
about Javascript, they say that it is "Lisp in C's shoes"
where and how can this feature of the language be useful?
Answer the question
In order to leave comments, you need to log in
eval - deprecated starting from es5
There are more advanced ways to execute the generated code at runtime, the simplest and most cross-platform one is the Function constructor.
This is used for meta-programming, that is, when the program changes itself
https://ru.wikipedia.org/wiki/% D0%9C%D0%B5%D1%82%D...
https://habrahabr.ru/post/137446/
https://habrahabr.ru/post/227753/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question