Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2972815

Browse files
method() method
1 parent fa4539c commit 2972815

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎05-object-creation.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,12 @@ new SandBox('dependencies', 'here', function(box){
171171
* pros: save some typing, more concise, small and focused methods
172172
* cons: may get a bit harder to debug - lot happening on a single line
173173
* JQuery uses it
174+
175+
## ```method()``` method
176+
177+
* making JavaScript a bit more class-like (which is probably a bad idea)
178+
* some syntactic sugar to add functions to the prototype property of the constructor
179+
180+
```js
181+
var Person = fucntion(){...}.method('methodName', function(){ ... });
182+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /