In the object-oriented and prototype chapter, the feeling is quite interesting, and the video explanation is also very clear, here summed up the video
Talk about the content, by the way to organize their own ideas.
First draw a picture,
Q3: How is the data type detected? What are the ways? What is the principle?Typyof detects the base data type , thereturn value is a string representing the data type, and is lowercase;instanceof detects the object type (the principle is to get an
JavaScript is not an object-oriented language, it is an object-based language. Everything is an object in JavaScript. The way to create custom objects in JavaScript article, I've covered basic methods for creating custom types. So how do you
Candy There is N children standing in a line. Each child is assigned a rating value.You is giving candies to these children subjected to the following requirements:
Each child must has at least one candy.
Children with a higher rating
First, get the browser size and locationSee also blog: http://www.cnblogs.com/bobodeboke/p/4653920.htmlSecond, get the size and position of the elementMethod one, using the Offsetxxx property1) Offsetheight: The element occupies space vertically,
There is no inherited gratitude in JavaScript. But we can emulate JavaScript's "inheritance" based on JavaScript's prototype:1. Write two function objects and assign one of the functions to the prototype of another function object:Operation Result:2.
1. Template Method mode 1.1 object-oriented implementation of template method patternTake tea and coffee for example, can be organized into the following four steps
Boil the water
Brew a drink in boiling water
Pour the drink into
1. Determine if the form element exists (i)if ("Periodpermonth" in Document.theform) {return true;}else{return false;}2. Determine if the page element existsif (document.getElementById ("XXX")) {Exist}3. Determine if the form element exists (ii)if
I. Function definitionMode 1. Normal way definition functionfunction name (parameter n) {function body}function Add (A, b) {return a+b;}Method 2. Direct Volume definition functionvar function name =function (parameter n) {function body}var
The event object is an object that the DOM provides more detailed information about the event, which is often used when defining event handlers, and in order to ensure that we get an event object that is not NULL, we need to first confirm that:1 if (
IntroducedPrototype mode (prototype) refers to the kind of object that is created with a prototype instance, and creates a new object by copying the prototypes.BodyFor prototype mode, we can take advantage of the JavaScript-specific prototype
Closures (closure) are a difficult and unique feature of the JavaScript language, and many advanced applications rely on closures.The scope of a variableTo understand closures, you must first understand the special variable scope of JavaScript.The
JavaScript: Execution context (Execution Contexts)Introduction
This chapter describes the execution context in the ECMAScript standard and various types of executable code.
In this article, I have referred to justinw's Chinese translation and made
Method call of the Array object in JavaScriptMethod concatfor loop and for in Loop
Join pop shift
Var arr = [,]; var arr2 = [, 4]; alert (arr. join (-); alert (arr. pop (); // Delete and return the last element. If the array is empty, //
JavaScript -- recursion, nesting, and closure
The three methods of function creation and recursion, nesting and closure are often easy to confuse.
Three methods of function Definition: 1. Declarative function (standard keyword function + function
Summary of JavaScript date object usage
Create a javascript Date object
Create a date object:Var objDate = new Date ([arguments list]);I have summarized the following parameters:New Date (month dd yyyy hh: mm: ss );// The following hh: mm:
JavaScript: Object creation mode (Part 1)Introduction
This article describes how to create objects. using various techniques, you can avoid errors or write very simple code.Mode 1: namespace)
The namespace can reduce the number of global names
JavaScript: Template Method of Design PatternIntroduction
The template method (TemplateMethod) defines the skeleton of an algorithm in an operation, and delays some steps to the subclass. The template method allows the subclass to redefine certain
JQuery event delegate instance analysis and jquery delegate instance analysis
Event delegation is mainly implemented by event bubbling. precise understanding of event delegation can help improve code execution efficiency. Let's take a look at a code
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