add a snippet for Crockford's object() function
This commit is contained in:
parent
4ce177eadd
commit
c85575e50d
@ -154,3 +154,10 @@ snippet sing
|
||||
|
||||
return instance;
|
||||
}
|
||||
# Crockford's object function
|
||||
snippet obj
|
||||
object(o) {
|
||||
function F() {}
|
||||
F.prototype = o;
|
||||
return new F();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user