This example describes the way JavaScript uses yield to simulate multithreading. Share to everyone for your reference. The specific analysis is as follows:
In both Python and C #, there are yield methods, which can achieve many multithreading by
The example in this article describes how JavaScript generates random strings. Share to everyone for your reference. The specific analysis is as follows:
This uses JavaScript to generate a random string that specifies the length of the string.
The example in this article describes how JavaScript changes the original object valueof. Share to everyone for your reference. The specific analysis is as follows:
The objects in JS contain the valueof method, we can replace the original object by
This example describes how JavaScript converts a string into a character-coded list. Share to everyone for your reference. Specifically as follows:
JavaScript converts a string into a list of character encodings, such as Foo converted to [112,111,11
Two-level linkage in general Web pages everywhere, is generally the address, such as the click of Zhejiang Province, then appeared in Hangzhou, Jiaxing; Click on the Beijing province appears Chaoyang, Haidian, and not appear in Hangzhou, Jiaxing.
This example describes how JavaScript removes a specified value element from an array. Share to everyone for your reference. The specific analysis is as follows:
The following code uses two ways to delete an element of an array, the first defines a
The function is very simple, the code is also very concise, here is not much nonsense
function fullscreen () {
var el = document.documentelement,
RFS = El.requestfullscreen | | El.webkitrequestfullscreen | | El.mozrequestfullscreen | | El.
1.confirm message dialog box
Syntax: Confirm ("str");
Parameter description: STR is the text to be displayed in the dialog box,
Role: Usually used to remind users to make certain choices, the return value is Boolean type, click to determine the
One of the tips here is how to use JavaScript to get the selected text on a page. The most critical JavaScript APIs are:
Copy Code code as follows:
Event.selection = Window.getselection ();
The selection here is actually an
CSS pseudo Element (pseudo-elements) is very useful-you can use it to create a CSS triangle, used in the Tip box, you can also use it to do a lot of simple tasks, without the need for extra HTML elements. Previously, the CSS properties of pseudo
The delete operator is not commonly used in JavaScript, but his features are really bizarre.
1, delete the properties of the object, code:
Copy Code code as follows:
var o = {
A:1,
B:2
};
Delete o.a;
alert (O.A); Undefined
The example in this article describes how JavaScript determines whether a string contains a specified substring. Share to everyone for your reference. The specific analysis is as follows:
The following JS code, which is useful for a string object,
JavaScript closure is a feature of its active development and a passive development. In other words, on the one hand, JS has a closure can better solve some problems. On the other hand, JS in order to solve some problems, but have to use closures
We're used to seeing anonymous functions like this.
Copy Code code as follows:
(function () {
Console.log ("test");
})();
It's been called an anonymous function that was executed (self-executing anonymous functions)
It turns out
Because of the error in language design, arguments can be treated as an array.
Copy Code code as follows:
function zero () {
Console.log (Arguments[0]);
}
There will also be
Copy Code code as follows:
We talked about the Javascript call method, and this time we're going to say the Apply method like say and called.
Apply vs Call
The difference between the two is whether a parameter is passed, or an array of arguments
This is the use of call.
The example in this article describes the way JavaScript deletes an array element. Share to everyone for your reference. The specific analysis is as follows:
JS can delete an array element through delete, but the size of the array will not change
This article illustrates how JavaScript connects all the elements of an array through a join function. Share to everyone for your reference. The implementation methods are as follows:
The output results are as
The examples in this article describe the way JavaScript uses arrays as stacks. Share to everyone for your reference. Specifically as follows:
JavaScript uses arrays as a code example for stacks, and supports stack-popular push and pop methods
This example describes how JavaScript displays the current date and time in the browser title bar, and shares it for your reference. Specifically as follows:
Put this script in the head area:
The wants this article to help you with your
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