I really don’t like the “non-destructive” expression but I couldn’t come up with a better one.
What?
You want to create a function but you will overwrite the old one. You just want to add some code before or after it.
Example, you create a javascript applet that can be added to web sites you do not own […]
Read the complete article...
Now is the time. I can’t go forward if I don’t talk about closures. What are closures? Closures are your friend. That’s the first thing you need to know about them. They will help you keep your code clean, healthy and easy.
A closures is created every time you create a function in a function (they […]
Read the complete article...
In javascript, all functions are an instance of the class Function (with a capitalized F).
The old way
Everybody knows how to do it. In fact most languages do it this way. Boring but you can’t write javascript without knowing it.
[source:javascript]
function f() {
}
[/source]
The uppercase F way
You can directly create an instance of the Function class this way.
[source:javascript]
var […]
Read the complete article...