In a lot of code, it's very common to see an init
function be declared, like so:
var someObject = {
// What is this for?
init: function () {
// Call here.
}
};
Are there anything particularly special about the init function that I should know?
For some frameworks perhaps (though prototype
and backbone
use initialize
instead), but there is nothing special about the init
functions in plain old javascript
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With