Home > Web Front-end > JS Tutorial > js static method and instance method analysis_javascript skills

js static method and instance method analysis_javascript skills

WBOY
Release: 2016-05-16 18:05:12
Original
873 people have browsed it
js static method
Copy code The code is as follows:

function foo( ){} // Declare class
foo.method = function(){} // Method body

uses: foo.method()

js instance Method
function foo(){ // Declare class
this.method = function(){ // Method body

}
}
Use: var f = new foo(); f.method();
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template