JavaScript object oriented and prototype

JavaScript object oriented and prototype I. Preface ECMAScript has two development modes: 1. Functional (programming), 2. Object oriented (OOP). Object oriented language has a sign, that is, the concept of class, through which any number of objects with the same properties and methods can be created. However, ECMAScript does ...

Posted on Wed, 01 Apr 2020 21:07:50 -0700 by lizard

Chapter 4 JS foundation scope and closure

Return to chapter catalog Catalog 1. Scope and free variable Scope of action Free variable 2. closure 3.this 4. exercise questions 1. Handwriting bind function 2. Make a simple cache tool 3. Create 10Tag, the corresponding serial number will pop up when clicking 1. Scope and free variable ...

Posted on Wed, 29 Jan 2020 02:10:40 -0800 by mcerveni

js to realize the conversion from decimal real number to binary

During the holiday, in Baidu front-end College (a very excellent free learning platform), there is a whole set of learning routes on the front-end of zero basic learning. You can do it while watching. In the process of doing it, you can find many unexpected problems. While correcting the mistakes, you are also accumulating expe ...

Posted on Mon, 06 Jan 2020 09:54:55 -0800 by bigscanner

vue.js2.0 to realize the rolling effect of better scroll

What is better scroll Better scroll is a mobile scrolling solution, which is based on the rewriting of iscroll. The main differences between it and iscroll are as follows Here  . Better scroll is also very powerful. It can not only do ordinary scrolling lists, but also do carousel charts, picker s and so on. <templat ...

Posted on Wed, 01 Jan 2020 04:26:26 -0800 by tores

Vantui pop-up window does not pop up or has no mask

background ####Component PopupTime.vue Take the pop + time selector of the vant official website as a component:popup1show: true means pop-up display <template> <div class="PopupTime"> <van-popup v-model="popup1show" position="bottom" :overlay="true" @click-overlay="clickOverlay"> < ...

Posted on Mon, 30 Dec 2019 11:02:36 -0800 by webmasternovis

Object oriented (create object) - Summary of seven patterns

Factory pattern (although factory pattern solves the problem of creating multiple similar objects, it does not solve the problem of object recognition (that is, how to know the type of an object)) function createPerson(name, age, job) { var o = new Object(); o.name = name; o.age = age; o.job = job; o.sayNam ...

Posted on Thu, 19 Dec 2019 14:59:46 -0800 by mistcat

Explain the new properties of ECMAScript2019/ES10

Every year, some new attributes come in ECMA262 Standard, ECMAScript2019/ES10 released this year also has many new features. This article will select some new attributes that ordinary developers will use for in-depth interpretation. Array.prototype.flat() The flat() method creates a new array with all sub-array elements concatenated into it rec ...

Posted on Tue, 10 Dec 2019 05:36:49 -0800 by MiCR0

What's the difference between using "let" and "var"?

ECMAScript 6 Introduction let statement . I heard it was described as a "local" variable, but I'm still not sure how its behavior differs from the var keyword. What's the difference? When should let use var? #1 building Scope rules The main difference is the scope rule The scope of the variable declared by the var ke ...

Posted on Thu, 28 Nov 2019 00:51:46 -0800 by StripedTiger

Deep understanding of ES6 Modules

Learn more about ES6 Modules At present, almost all of our projects are developed based on Web pack, roll up and other construction tools, and modularity is the norm. We are not new to it. Today, we will review the module mechanism of ES6 systematically, and summarize the commonly used operations and best practices, hoping to help you. Some sim ...

Posted on Fri, 08 Nov 2019 00:17:15 -0800 by shneoh

Manual implementation of call and apply methods

call implementation Syntax:fun.call(thisArg, arg1, arg2, ...) Parameters:thisArg This value is specified when the fun function runs. If (thisArg = undefined | null) this = window, if (thisArg = number | Boolean | string) this = new Number ()| new Boolean ()| new String () arg1, arg2, ... List of specified parameters. Function.prototype.call2 ...

Posted on Sun, 06 Oct 2019 19:50:59 -0700 by gojakie