R
R
Rafael™2016-08-19 19:16:39
JavaScript
Rafael™, 2016-08-19 19:16:39

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

1 answer(s)
D
Dmitry Belyaev, 2016-08-19
@bingo347

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 question

Ask a Question

731 491 924 answers to any question