We can regard call and apply as methods of an object. The first real parameter of call and apply is the parent object of the function to be called indirectly by calling methods, it is the call context and obtains reference to it through this in the
First, the characteristics
variable data types;
The size of the array can be adjusted dynamically;
Has the length property, and the length property is not read-only, can be set;
Ii. Method of Creation
Use the array
Unary operatorAn operator that can manipulate only one value is called a unary operator. The unary operator is the simplest operator in ECMAScript.1. Increment and decrement operatorsThe increment and decrement operators draw directly from C, and
This is a concept in object-oriented programming, which generally points to the object where the current method call resides, which is very clear in the more restrictive object-oriented programming languages such as Java and C + +. But in JavaScript,
Use JavaScript to detect browsers
If you really need to check the browser type, it is easy to implement it using JavaScript.
View Demo
Download Source from GitHub
JavaScript has a standard navigator object that contains information about browser
Var ie =! -[1,];
This code was called the world's shortest IE judgment code before IE9.The code is short but contains a lot of basic javascript knowledge.In this exampleThe toString () method of the array is called before code execution. Run [1,].
JS implementation:1, the composition of JavaScript implementation:Core (ECMASCRIPT): defined by ECMA-262, providing core language functionalityThe Document Object Model (DOM) provides methods and interfaces for accessing and manipulating Web page
1.!! !! The role of type conversion is to convert the corresponding type to Boolean, the first one! Take the reverse, the second one is reversed var Flag=5;alert (!! Flag);//true!! Converts all incoming parameters to Boolean, True and false; When
ECMA: European Association of Computer ManufacturersISO/IEC: International standardization and International Electrotechnical CommissionDOM Level (10*) Document Object model1:dom core (Map-based XML document) and Dom HTML (based on the DOM core)2:
This article mainly introduces the clever use of setTimeout in JS. For more information about front-end function throttling, see
What is function throttling?
In simple terms, function throttling does not require the function to be called
This article mainly introduces three inheritance implementation methods in javascript, including using Object. create implements class inheritance and uses the util that comes with the utilities toolkit. inherites. It is very practical to use the
One: HTML ()html()function is used to set or return HTML content within the DOM element that the current jquery object matches .The purpose of this function is to set or get the property value of a DOM element innerHTML .The function belongs to an
JavaScript functions 定义时上下文 运行时上下文 have concepts such as "" and "" and " 上下文是可以改变的 "apply and call functions
Call () and apply () all exist to change a function 运行时的上下文 (context), in other words, to change the direction of this within the
JavaScript, andNoA method that directly provides object cloning.The assignment in JavaScript is not actually a copy of the object, but rather a reference (or pointer) in a ' C + + ', so the element in object A is changed when the element in object B
Javascript NoteChapter one 1.1 values JS has six basic value types: number,string,boolean,object,function,undifined1.2 The number computer uses a sequence to store data in memory, JS uses a fixed-length bit sequence of 64 to hold numeric
This document is translated from JavaScript ' s zerosJavaScript has both zeros:? 0 and +0. This post explains, why, and where it matters in practice.There are two "0" in JavaScript:-0 and +0. This article explains why, and points out the impact of
Both call and apply are intended to change the context in which a function is run, in other words, to change the direction of this within the function body .Call and apply work exactly the same way, but accept parameters differently.Method
ObjectiveThe variable in JavaScript is loosely typed, which means that when a variable is declared it can save any type of value, or it is not like SQL to declare that a key value of int can only hold the integer value, stating that varchar can only
variables [coercion] variables and functions must be defined before they are used.// goodvar name = ‘MyName‘;// badname = ‘MyName‘;[Force] Only one variable can be declared per var.Explain:A var declares multiple variables, which can lead to a
Original address: http://blog.csdn.net/lowkeysk/article/details/8175195 thank the authorThis article describes the parse () method in Json2.js of JavaScript in JSON.The following is an introduction to the original text in Json2jsJson.parse (text,
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.