In our projects, especially our web projects, no matter what language you write, java, C #..... javaScript, a front-end scripting language, plays an important role. Next we will take you into JavaScript, explore the mysteries, learn together, and make common progress !... SyntaxHighlighter. all (
In our projects, especially our web projects, no matter what language you write, java, C #..... javaScript, a front-end scripting language, plays an important role. Next we will take you into the JavaScript field, explore the mysteries, learn together, and make common progress !!
1. To understand JavaScript in depth, you must first put down the concepts of objects and classes and return to the source of data and code. As mentioned above, there are only two basic elements in the programming world: Data and code, and these two elements have an ambiguous relationship. JavaScript simplifies data and code to the most primitive level.
2. The data in JavaScript is concise. Simple data only includes undefined, null, boolean, number, and string, and complex data contains only one type, namely, object. The code in JavaScript is only reflected in one form, that is, function. Note: The above words are in lower case. Do not confuse them with JavaScript built-in functions such as Number, String, Object, and Function. You know, JavaScript is case sensitive!
3. Any JavaScript identifier, constant, variable, and parameter is only one of the unfined, null, bool, number, string, object, and function types, that is, the type indicated by the typeof return value. There are no other types.
Eg: var a = 123, typeof (a) ----> number; var B = "123", typeof (B) -----> string; var c = null, typeof (c) ----> object; var d = true
Typeof (d) ---> bool; var e = undefined, typeof (e) ----> undefined; var f = function () {alert (1)}; typeof (f) -----> function
4. JavaScript has no class concept. Only functions are defined by functions. JavaScript Functions are the essence of objects. Function definition method: