There is no symmetry between data and code in JavaScript. You’re talking about homoiconicity, as exemplified in Lisp. Homoiconicity is defined as:

Homoiconicity (from the Greek words homo meaning the same and icon meaning representation) is a property of some programming languages in which the program structure is similar to its syntax, and therefore the program’s internal representation can be inferred by reading the text’s layout. If a language is homoiconic, it means that the language text has the same structure as its abstract syntax tree (AST) (i.e. the AST and the syntax are isomorphic). This allows all code in the language to be accessed and transformed as data, using the same representation.

(From Wikipedia.)

JavaScript is not in the least bit homoiconic, which is why claiming that JavaScript was inspired by Lisp is misleading. Homoiconicity is the defining quality of Lisp.

JavaScript code is not stored internally as JSON objects. JSON is a data interchange format external to the JavaScript language spec and external to its implementation.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store