Tag : javascript

Closure, which obtains access rights to variables in a local scope, involves scope stack, execution context, garbage collection mechanism, memory resident and performance issues. Closure cuts off garbage collection events generated by scope stack to realize memory resident of variables. The main application scenarios need cumulative effect, repeated cycle events, correlation of front and back ..

Read more

Please fill in the code so that mySort () can display the passed parameters in descending order. function mySort() { var tags = new Array(); for (var i = 0; i < arguments.length; i++) { tags.push(arguments[i]); } tags.sort(function sortNum(a, b) { return a – b; }); return tags; } var result = mySort(50, 11, 16, ..

Read more

1, prototype chain inheritance function Parent() { this.name = ‘Mike’ } function Child() { this.age = 12; } Child.prototype = new Parent();//Child继承Parent,通过原型,形成链条 var test = new Child(); console.log(test.age); console.log(test.name);//得到被继承的属性 //继续原型链继承 function Brother() {//brother构造 this.weight = 60; } Brother.prototype = new Child();//继续原型链继承 var brother = new Brother(); console.log(brother.name); console.log(brother.age); 2. Borrow constructors (class inheritance) function Parent(age) ..

Read more

H5 series Ten Ways to Optimize Page Loading Speed Essay classification-HTML5 40 Most Important Technical Points in HTML5 Meta collation Details of Web Performance Management HTML5 offline cache -manifest introduction JS series Writing High Performance JavaScript Interesting JavaScript Native Array Function JavaScript Data Access Performance Optimization Scheme Nine Sorting Algorithms Implemented by JavaScript Javascript-Arguments Object ..

Read more

Eight Mind Maps for Learning Javascript The pictures here sometimes hang up, so it is better to post the big picture of the site for reading experience.Original:Eight Mind Maps for Learning JavascriptSites:Front-end development document Javascript variable Javascript operator Javascript array Javascript flow statement Javascript string function Javascript function basis Javascript basic DOM operations Javascript regular ..

Read more

JS common method function String length truncation Inert evaluation closure Basic Package Type (Package Object) Object traversal (best method) Array traversal (built-in method) How do you determine whether an object is an array? Addition table Sort method Prefix specification Douglas’ object method (equivalent to the object.create method) 1. String length interception function cutstr(str, len) { ..

Read more

HTML5 Using FileReader to Preview Front-end Pictures How to get all checkbox in the page? (No Third Party Framework) JavaScript Template Engine Instances Javascript Implement JS function overload JS Cross Browser Binding Event Function JS monomer mode Object method defined using prototype property Closure Implements Result Caching Closures Implement Encapsulation Closures Implement Classes and Inheritance ..

Read more

Collect regular expression instances that are often used in business to facilitate later search and reduce workload. Verify Basic Date Format Verify password strength Check Chinese A string of numbers, 26 English letters, or underscores Verify E-Mail address Verify ID Number Verification date Check amount Check the phone number Judging IE version Verify IP-v4 address ..

Read more

Recently, I am studying deeply and trying to master it as soon as possible.Node.jsConsider writing an article to record what needs to be recordedConcept、Methodas well asCode instanceTo facilitate searching in actual projects. This article will be updated continuously, or another article will be published to discuss more core and key technical issues. This is a ..

Read more

Ajax status code,xhr.readyState 0: unsent not sent, Ajax object created, default value 01: Opened Executionxhr.open2: headers _ received the current ajax request has been sent and the corresponding header information returned by the server side has been received3: Loading Response Body Content Returning4: Done’s corresponding subject content has been returned to the client Http network ..

Read more