An orientation-oriented first experienceCreate a label// 传统var=document.createElement(‘p‘);var=document.createTextNode(‘我是传统js创建的文字‘);p.appendChild(txt);document.body.appendChild(p);// 面向对象
This week is less time, not learning something new, reviewing some of the regular expressions you learned before, and writing a block of code that can be replaced by strings.var s= "Zhang 356 points, Li 474 points, Wang 592 points, Zhao 684
This article mainly explains the group match and the forward match in the regular expression of JavaScript, need to have the basic understanding to the regular, I have been to two kinds of match ambiguity unclear. So summarize here, if there is not,
We often encounter some pits in the callback function:var obj = { name: ‘qiutc‘, foo: function() { console.log(this); }, foo2: function() { console.log(this); setTimeout(this.foo, 1000); } }obj.foo2();Executing this code we will find
This is a keyword in the JavaScript language.It represents an internal object that is automatically generated when the function is run, and can only be used inside the function. Like what
function Test () {
this.x = 1;
}
The
Since our CSS has to be placed in a special style tag, JavaScript also needs to be placed in the child's tag, which is the script tagIn the page, we can put tag pairs in the body tag , tag pairsWe can define it directly in the body or in heard,
In a nutshell: This in the JavaScript function always points to the direct object that called the function. Of course through apply (), call (), bind () These methods can change this exceptInstance 1:alert (this = = = window); True the direct object
Use the quick sort in the book "JavaScript Data Structures and algorithms" and add your own understanding.This algorithm has been tested faster than the built-in sort! And the Nanyi of the fast platoon is more like a merge sort, although the writing
Spec. 1: Be sure to write down global variables, and try to implement various functions, repeating code, etc. into a function.Advantages: It helps to read and maintain. Prevent variable contamination.Spec 2: All functions, variables, semantics. Spec.
I. Overview
The RegExp object represents a regular expression, which is a powerful tool for performing pattern matching on strings.
A regular expression is a search pattern formed by a sequence of characters.
When you search for
Const ReadLine = require ("Readline-sync"); let time= 0;//number of passwords lostLet x = 1;//Temp VariableConsole.log ("Please enter your password"); let password= Readline.question ()-0; while(Password! = 123456) {Console.log ("The password you
To get the vertical position of the scroll bar for the current page, use:Document.documentElement.scrollTop;Instead of:Document.body.scrollTop;The documentelement corresponds to an HTML tag, and the body corresponds to the body tag.DocumentElement
I've been listening to you on Himalaya. (JavaScript Web front-end) host ShahiIt's a good one. Buy this book now make a notevar str = ' ABCD 'Str.charat (0); Output the character of the subscript positionStr.charcodeat (0);//The character encoding
The first approach: using Built-in methodsThe split () method splits each character of a string object and treats each string as each element of the arrayThe reverse () method is used to change the array, order the elements in the array sequentially,
JavaScript Operation Cookies DetailedThis method of operating cookies I used for a long time, but has not encountered any problems, today in the first page to save the cookie, the second page Gets or the third page to get the function, found the
In fact, the earliest look at the design pattern is the simple understanding of the JS language itself, so it is easy to forget after reading the understanding, perhaps after the actual work needs to remember it;Look below: "en"> "UTF-8">
language Standard Version name: ECMAScript (ECMA is the European Association of Computer manufacturers, it is said that it may be a standard, in addition to JavaScript to follow this standard, there are xx .... )Jscript (ie's description of the
Several ways to de-weigh javascript arrays
Creates a new empty array, iterates through For...of (ES6), and, by IndexOf, determines whether the element exists in the new array, and then push the nonexistent (INDEXOF (n) ==-1) element to the new
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.