Avascript can be said to be the most widely used language today, although the client browser script, but the use of JavaScript can do a lot of unexpected effects, due to the good and bad programmers, there will be inevitable redundant code.
Avoid
Use system function String.localecompare compare size, array.sort sort can complete
var arr = [' Middle ', ' country ', ' God ', ' zero '];var result = Arr.sort (function (a,b) {return A.localecompare (b); ["Country", "zero", "God", "middle"]})
1, what's the closure?(Baidu Encyclopedia definition)--closures are blocks of code that can contain free (unbound to specific) variables that are not defined within the code block or in any global context, but are defined in the environment where
The delete in JavaScript is an operator (also a keyword) that can be used to delete a specified property from an object, or to delete an element from an array.
Delete Object Properties
var obj = {};obj.x = 20;OBJ.Y = 10;
Delete a property of an
NPM's modules are written in JavaScript, but cannot be used by browsers because the COMMONJS format is not supported. To allow browsers to use these modules, you must convert the format.This article introduces the principle of browser loading
I. BACKGROUND
There are two major projects from the RD side of the migration, because the initial project FE unmanned follow-up, so are the backend students directly with Smarty to complete the front-end part; So considering the cost of migration
In general, you can implement an assignment by using "=". But for data of these reference types, such as arrays, objects, functions, and so on, this symbol is not good.
1. Simple copy of array
1.1 Simple traversal
The simplest and most basic way,
In the process of object-oriented programming (assembling a computer), there is usually no need to care about the internal implementation of objects (such as hard disk) data, which we call the encapsulation of objects, which we refer to as
1. When an object is not visible, in IE is not to set its focus, but in Firefox can2. Append Rows to table:In the FF, Safari, opera and other browsers, use Document.createelement to create the row with Document.appendchild to add the row directly to
First to introduce the practice of JS
The code is as follows
Copy Code
function Tourl (UL) {if ("" = = UL | | Null==ul) {Alert ("Thank you for attention");}else{WINDOW.OPEN (UL);//This is a new window.window.location.href=
Definitions and usageThe replace () method replaces some characters in a string with some other characters, or replaces a substring that matches a regular expression.
GrammarStringobject.replace (regexp/substr,replacement) parameter
First, the function realizes the core: FileSystemObject objectIn fact, to implement the file operation function in JavaScript, the main thing is to rely on the FileSystemObject object.Ii. FileSystemObject Programming TrilogyProgramming with a
Tip: You can modify some of the code before running
Simple and practical music anycast effect and Between--> and --> erait-mediaplayer V1.0 version music 1 music 2 music 3
A little question today: how do I get the return value of a JavaScript asynchronous function?
1. Wrong attempt
My initial attempt when I did not enter:
In programming languages, objects are not as ubiquitous as they are in the real world. We usually only have a few native objects, and the rest should be created by ourselves. In Java, this is what we do when we create a cool chicken:Public class
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service