The history of Javascript
background
- JavaScript was originally designed by Netscape’s Brendan Eich and originally named its scripting language LiveScript, before Netscape changed its name to JavaScript after working with Sun. JavaScript was originally designed to “look like Java” because it was inspired by Java, so there are syntactic similarities, and some names and naming conventions are borrowed from Java, but the main design principles of JavaScript come from Self and Scheme. The similarity between JavaScript and Java names was the result of an agreement Netscape struck with Sun Microsystems for marketing purposes at the time. Microsoft also launched JScript, a scripting language to compete with JavaScript, around the same time.
The operation mode
- JavaScript is a kind of high-level scripting language belonging to the network. It has been widely used in the development of Web applications. It is often used to add various dynamic functions to Web pages and provide users with smoother and more beautiful browsing effects. JavaScript scripts are often embedded in HTML to achieve their own functionality.
The main function
- Embed dynamic text in HTML pages.
- Responds to browser events.
- Reading and writing HTML elements
- Validate data before it is submitted to the server.
- Detect the visitor’s browser information. Control cookies, including creation and modification.
- Server-side programming based on Node.js technology.
The language of
- ECMAScript, which describes the syntax and basic objects of the language.
- Document Object Model (DOM), which describes methods and interfaces for handling web page content.
- The Browser Object Model (BOM), which describes the methods and interfaces for interacting with the browser.
Language features
- Scripting languages.
- Object based.
- Simple.
- Dynamics.
- Cross-platform.
JavaScript were born
- The Javascript language is actually a hybrid of the two language styles —- (simplified) functional programming + (simplified) object-oriented programming. This was decided by Brendan Eich (functional programming) and Netscape (object-oriented programming).
10 Design Flaws with JavaScript
- Not suitable for developing large programs
- Very small standard library
- Null, and undefined
- Global variables are difficult to control
- Automatic insertion of end-of-line semicolons
- The plus operator (unnecessarily complicates the operation; a separate concatenation operator is perfectly fine.)
- NAN (NAN is designed to simplify the program rather than the interpreter reporting errors directly)
- Distinction between arrays and objects
- == and === (==) are used to determine whether two values are equal. When two value types are different, an automatic conversion occurs, and the result is very counterintuitive.)
- Wrapper objects of primitive types (object types corresponding to primitive data types are of little use but cause a lot of confusion)