There are two special values in JavaScript: undefined and null, which need to be noticed when comparing them. The undefined value is obtained when reading an unassigned variable or attempting to read an attribute that is not in an object.
1 is also a few basic concepts
Why do you say it again?
In discussing inheritance, we have listed some basic concepts that are closely related to encapsulation, and the basic concepts we are going to discuss today are mainly about inheritance and
There are several ways to create objects in javascript:
(1) Using built-in objects
(2) using JSON notation
(3) Custom object construction
first, use the built-in objects
The built-in objects available to JavaScript can be grouped into two
We know that a complete JavaScript implementation needs to consist of three parts: ECMAScript (Core), BOM (Browser object model), DOM (Document Object model).
Today the main learning BOM and DOM.
Bom:
The BOM provides a lot of objects to access
Introduction
JavaScript is a powerful, but misunderstood programming language. Some people like to say that it is an object-oriented programming language, or it is a functional programming language. Others like to say that it is not an
This example describes the JavaScript minesweeper game. Share to everyone for your reference, specific as follows:
Turn out the game posted at the beginning of the year, mine clearance I believe that we have played, the first figure:
Source:
JavaScript Form Validation Regular expression encyclopedia
Using regular expressions to determine whether the Arabic numerals are 0-9
Copy Code code as follows:
function Regisdigit (fdata)
{
var reg = new RegExp ("^[0-9]$");
This article convention: in the case of a special declaration, an attribute is referred to as a property or method.
Creating objects, object inheritance is actually one thing: the instance object we need obtains the private property through the
event model and its principleBackbone.events is the core of the event implementation, which allows the object to have event capabilities
var Events = Backbone.events = {...}
Object listens to other objects through Listento, triggering
Tree-structured data is often used in writing libraries, and some tree-structured data is very demanding from root to leaf paths. For example, the entire routing table of a site is such a tree, and its "path" is actually the path part of the URL. So
The difference between a deep copy of an object and a shallow copy is as follows:
Shallow copy: Simply copy the object's reference, not the object itself;Deep copy: Copies all the objects referenced by the copied object.
I. Implementation of a
Domobj.onkeydown = function (e) {
if (e) {
e ...
} else{
event ...
}
The above example: if the Firefox browser executes the statement within if, that is, use the E parameter to refer to the "event object".
If the IE browser executes the
Interface: A set of principles for accomplishing a task, function, purpose, etc.
Interfaces in programs: There are several ways to specify what the method name is. (Because the program to complete the task, is through the function or the method to
The inverse cosine of the radian returned by this method. The ACOs method returns the numeric value of 0 and pi for radians between x-1 and 1. Returns Nan if the value of the number is outside this range.Grammar
Math.acos (x);
The
There are a number of ways to define classes in JS:
1. Factory mode
function car () {
var ocar = new Object;
Ocar.color = "Blue";
Ocar.doors = 4;
Ocar.showcolor = function () {
document.write (This.color)
};
return ocar;
}
var car1 = car ();
var
JavaScript provides full control to handle loops and switch statements. There may be a situation when you need to exit a loop but not reach its bottom. There may also be a situation when you want to skip over a portion of the code block and start
The ForEach () method of a JavaScript array invokes each element in the array.Grammar
Array.foreach (callback[, Thisobject]);
The following are the details of the parameters:
Callback: Function tests each element of an array.
Ternary operator Usage Example:
The ternary operator, as the first name indicates, requires three operands.
Grammar is a condition? Result 1: Results 2;. Here you write the terms on the question mark (?) followed by a colon (:) separated by a
Scope of a variable
To understand closures, you must first understand JavaScript's special variable scope.
The scope of a variable is nothing more than two kinds: global and local variables.
The special point of the JavaScript language is that the
JavaScript allows you to create and open windows that represent HTML text, form objects, and frame. The Window object is the topmost object in the JavaScript client hierarchy, and the form element and all JavaScript code exist in the document, and
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