Category : javascript

1. Preface Following the last timemake a casual demonstration of one’s capabilityHaving tasted the benefits of high-priced components, they are now in deep trouble. . . So what will it bring this time? Today, let’s look at what sparks [high-level components] and [New Context API] can spark! 2. New Context API The Context API actually ..

Read more

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