javascript object-oriented

javascript object Creating Object Method 1. Use constructors to create: var cat = new Object(); cat.name = "hello kitty"; cat.age = 3; cat.call=function(){ alert("miao~~"); } 2. Create an object using object literals var cat { name: "hello kitty", age = 3, call:function(){ alert("miao~~"); } } Because cl ...

Posted by Prine on Tue, 16 Apr 2019 10:30:34 -0700

es6 Quick Start

es6 Quick Start ES6 introduction ECMAScript 6.0 (hereinafter referred to as ES6) is the next generation standard of JavaScript language, which was officially released in June 2015. Its goal is to enable JavaScript language to be used to write complex large-scale applications and to become an enterprise-level development language. The relations ...

Posted by capslock118 on Mon, 08 Apr 2019 16:27:31 -0700

JavaScript prototype chain, prototype, _proto_ detailing

1, background The concepts of Javascript inheritance model, prototype chain and so on are rather obscure and difficult to understand. Many people did not intentionally understand the principles of Javascript when they used it in the past. Today, I will analyze the inheritance, prototype, prototype in Javascript step by step. The author does no ...

Posted by dniezby on Tue, 02 Apr 2019 19:51:29 -0700

Elevation 6.1 Understanding Object Self-reading

object Objects have properties, Attribute types Data attributes and accessor attributes Data attribute Data attributes contain data values: Value The characteristics of data attributes (used to describe the behavior of data attributes): [[Configurable]]: - Can we pass? delete Delete attributes to redefine attributes ...

Posted by Magestic on Sat, 30 Mar 2019 19:54:30 -0700

JavaScript object learning

object Objects are dynamic -- attributes can be added or deleted, but objects are often used to simulate static objects and "structs" in static typed languages. Object attributes can be added and deleted. Object characteristics * Object prototype: Points to another object whose properties inherit from its prototype object. * class ...

Posted by gergy008 on Thu, 28 Mar 2019 01:18:31 -0700

JavaScript Advanced Programming Reading Notes (3) (Chapter 3)

Process statement: Some unusual process statements are listed: 1. do-while statement: Before evaluating conditional expressions, the code in the loop is executed at least once: var i = 0; do { i += 2; } while (i < 10); alert(i); ==>Eject10 2. for-in statement: The for-in statement is a precise iteration statement that can be ...

Posted by Fusioned on Mon, 25 Mar 2019 21:06:28 -0700

Five Ways of Implementing Inheritance in js

js is a flexible language. There are many ways to realize a function. ECMAScript does not have a clear inheritance mechanism, but through imitation. According to the characteristics of js language, there are several common ways for js to realize inheritance 1. Implementing inheritance by impersonating objects (this way can achieve multiple i ...

Posted by bradjinc on Mon, 25 Mar 2019 12:21:28 -0700

Promise, the Artifact in Javascript

Promise in js The real problem with callback functions is that they deprive us of the ability to use the keywords return and throw. Promise solves all this well. In June 2015, The Official Edition of ECMAScript 6 It was finally released. ECMAScript is the international standard of JavaScript language, and JavaScript is the implementation of E ...

Posted by trevHCS on Sat, 23 Mar 2019 10:06:53 -0700

Examples of webpack2: Scope Hoisting and Code Splitting

Links to the original text: https://github.com/webpack/we...Translator: @justjavac This example demonstrates Scope Hosting combined with code splitting. This is the dependency graph for the example: (solid lines for synchronous imports, dashed lines for asynchronous imports) All modules except cjs are EcmaScript modules. cjs is a CommonJs modu ...

Posted by Nick Zaccardi on Tue, 12 Feb 2019 19:51:19 -0800

Introduction to TypeScript

Introduction to TypeScript Before using TypeScript, we need: Installing TypeScript uses nmp-v to check whether npm is installed Use tsc-v to check whether the TypeScript environment is installed or not, use NPM install-g type script installation environment, use tsc test.ts to mutate the TypeScript.ts file into JavaScript.js ...

Posted by rcity on Tue, 29 Jan 2019 04:39:14 -0800