Is there anything else I should do to improve my JS/Jquery skills?
Self-invoking Anonymous Function
(function ( ,ドル window, undefined ) {
doStuff();
})( jQuery, window );
The extra ()
at the end of the function, determines that it runs itself immediately.
First, we are creating a self-invoking anonymous function to shield ourselves from using global variables. We pass in ,ドル window, and undefined.
The arguments the self invoking function is called with are jQuery and window; nothing is passed in for undefined, so that if we decide to use the undefined keyword within the plugin, "undefined" actually will be undefined. This shields from other scripts potentially assigning a malicious value to undefined, such as true!
Now since ECMAScript 5 the "Immutable undefined" came along which is meant to protect you from exactly that. But as you can see from the answers to this recent question recent question I asked myself, this is not the case yet.
$ is passed as jQuery; we do it this way to ensure that, outside of the anonymous function, $ can still refer to something else entirely, such as Prototype.
Passing the variable for the globally accessible window object allows for more compressed code through the minification processes (which you should be doing, as well).
(function(b,a,c){doStuff()})(jQuery,window); //Same function after being compressed.
Thus every time you refer to window
in your code, when compressed it can be replaced with a simple a
(or any other letter for that matter) and depending on how much you use it, will improve your performance.
Use-Strict Mode
You should try to understand the reason why a declaration is used and not simply because someone is telling you to. JSHint isn't really a bible you should follow to the death. I'm not saying you shouldn't use it (you probably should use it), I'm saying that it's a good idea to study the "hints" it's giving you, and determine whether or not to use them.
In this case I highly recomend that you do use the strict mode. It will many times force you to write better code if you understand how it works.
As Nicholas C. Zakas puts it:
"Strict mode makes a lot of changes to how JavaScript runs. The intent is to allow developers to opt-in to a "better" version of JavaScript."
Here is the link to his article which might help you understand. http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/
Is there anything else I should do to improve my JS/Jquery skills?
Self-invoking Anonymous Function
(function ( ,ドル window, undefined ) {
doStuff();
})( jQuery, window );
The extra ()
at the end of the function, determines that it runs itself immediately.
First, we are creating a self-invoking anonymous function to shield ourselves from using global variables. We pass in ,ドル window, and undefined.
The arguments the self invoking function is called with are jQuery and window; nothing is passed in for undefined, so that if we decide to use the undefined keyword within the plugin, "undefined" actually will be undefined. This shields from other scripts potentially assigning a malicious value to undefined, such as true!
Now since ECMAScript 5 the "Immutable undefined" came along which is meant to protect you from exactly that. But as you can see from the answers to this recent question I asked myself, this is not the case yet.
$ is passed as jQuery; we do it this way to ensure that, outside of the anonymous function, $ can still refer to something else entirely, such as Prototype.
Passing the variable for the globally accessible window object allows for more compressed code through the minification processes (which you should be doing, as well).
(function(b,a,c){doStuff()})(jQuery,window); //Same function after being compressed.
Thus every time you refer to window
in your code, when compressed it can be replaced with a simple a
(or any other letter for that matter) and depending on how much you use it, will improve your performance.
Use-Strict Mode
You should try to understand the reason why a declaration is used and not simply because someone is telling you to. JSHint isn't really a bible you should follow to the death. I'm not saying you shouldn't use it (you probably should use it), I'm saying that it's a good idea to study the "hints" it's giving you, and determine whether or not to use them.
In this case I highly recomend that you do use the strict mode. It will many times force you to write better code if you understand how it works.
As Nicholas C. Zakas puts it:
"Strict mode makes a lot of changes to how JavaScript runs. The intent is to allow developers to opt-in to a "better" version of JavaScript."
Here is the link to his article which might help you understand. http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/
Is there anything else I should do to improve my JS/Jquery skills?
Self-invoking Anonymous Function
(function ( ,ドル window, undefined ) {
doStuff();
})( jQuery, window );
The extra ()
at the end of the function, determines that it runs itself immediately.
First, we are creating a self-invoking anonymous function to shield ourselves from using global variables. We pass in ,ドル window, and undefined.
The arguments the self invoking function is called with are jQuery and window; nothing is passed in for undefined, so that if we decide to use the undefined keyword within the plugin, "undefined" actually will be undefined. This shields from other scripts potentially assigning a malicious value to undefined, such as true!
Now since ECMAScript 5 the "Immutable undefined" came along which is meant to protect you from exactly that. But as you can see from the answers to this recent question I asked myself, this is not the case yet.
$ is passed as jQuery; we do it this way to ensure that, outside of the anonymous function, $ can still refer to something else entirely, such as Prototype.
Passing the variable for the globally accessible window object allows for more compressed code through the minification processes (which you should be doing, as well).
(function(b,a,c){doStuff()})(jQuery,window); //Same function after being compressed.
Thus every time you refer to window
in your code, when compressed it can be replaced with a simple a
(or any other letter for that matter) and depending on how much you use it, will improve your performance.
Use-Strict Mode
You should try to understand the reason why a declaration is used and not simply because someone is telling you to. JSHint isn't really a bible you should follow to the death. I'm not saying you shouldn't use it (you probably should use it), I'm saying that it's a good idea to study the "hints" it's giving you, and determine whether or not to use them.
In this case I highly recomend that you do use the strict mode. It will many times force you to write better code if you understand how it works.
As Nicholas C. Zakas puts it:
"Strict mode makes a lot of changes to how JavaScript runs. The intent is to allow developers to opt-in to a "better" version of JavaScript."
Here is the link to his article which might help you understand. http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/
Here are a couple of things you might want to add to your JS/jQuery skills and comprehension of the same:
Is there anything else I should do to improve my JS/Jquery skills?
Self-invoking Anonymous Function
(function ( ,ドル window, undefined ) {
doStuff();
})( jQuery, window );
The extra ()
at the end of the function, determines that it runs itself immediately.
First, we are creating a self-invoking anonymous function to shield ourselves from using global variables. We pass in ,ドル window, and undefined.
The arguments the self invoking function is called with are jQuery and window; nothing is passed in for undefined, so that if we decide to use the undefined keyword within the plugin, "undefined" actually will be undefined. This shields from other scripts potentially assigning a malicious value to undefined, such as true!
Now since ECMAScript 5 the "Immutable undefined" came along which is meant to protect you from exactly that. But as you can see from the answers to this recent question I asked myself, this is not the case yet.
$ is passed as jQuery; we do it this way to ensure that, outside of the anonymous function, $ can still refer to something else entirely, such as Prototype.
Passing the variable for the globally accessible window object allows for more compressed code through the minification processes (which you should be doing, as well).
(function(b,a,c){doStuff()})(jQuery,window); //Same function after being compressed.
Thus every time you refer to window
in your code, when compressed it can be replaced with a simple a
(or any other letter for that matter) and depending on how much you use it, will improve your performance.
Use-Strict Mode
You should try to understand the reason why a declaration is used and not simply because someone is telling you to. JSHint isn't really a bible you should follow to the death. I'm not saying you shouldn't use it (you probably should use it), I'm saying that it's a good idea to study the "hints" it's giving you, and determine whether or not to use them.
In this case I highly recomend that you do use the strict mode. It will many times force you to write better code if you understand how it works.
As Nicholas C. Zakas puts it:
"Strict mode makes a lot of changes to how JavaScript runs. The intent is to allow developers to opt-in to a "better" version of JavaScript."
Here is the link to his article which might help you understand. http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/
Here are a couple of things you might want to add to your JS/jQuery skills and comprehension of the same:
Self-invoking Anonymous Function
(function ( ,ドル window, undefined ) {
doStuff();
})( jQuery, window );
The extra ()
at the end of the function, determines that it runs itself immediately.
First, we are creating a self-invoking anonymous function to shield ourselves from using global variables. We pass in ,ドル window, and undefined.
The arguments the self invoking function is called with are jQuery and window; nothing is passed in for undefined, so that if we decide to use the undefined keyword within the plugin, "undefined" actually will be undefined. This shields from other scripts potentially assigning a malicious value to undefined, such as true!
Now since ECMAScript 5 the "Immutable undefined" came along which is meant to protect you from exactly that. But as you can see from the answers to this recent question I asked myself, this is not the case yet.
$ is passed as jQuery; we do it this way to ensure that, outside of the anonymous function, $ can still refer to something else entirely, such as Prototype.
Passing the variable for the globally accessible window object allows for more compressed code through the minification processes (which you should be doing, as well).
(function(b,a,c){doStuff()})(jQuery,window); //Same function after being compressed.
Thus every time you refer to window
in your code, when compressed it can be replaced with a simple a
(or any other letter for that matter) and depending on how much you use it, will improve your performance.
Use-Strict Mode
You should try to understand the reason why a declaration is used and not simply because someone is telling you to. JSHint isn't really a bible you should follow to the death. I'm not saying you shouldn't use it (you probably should use it), I'm saying that it's a good idea to study the "hints" it's giving you, and determine whether or not to use them.
In this case I highly recomend that you do use the strict mode. It will many times force you to write better code if you understand how it works.
As Nicholas C. Zakas puts it:
"Strict mode makes a lot of changes to how JavaScript runs. The intent is to allow developers to opt-in to a "better" version of JavaScript."
Here is the link to his article which might help you understand. http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/
Is there anything else I should do to improve my JS/Jquery skills?
Self-invoking Anonymous Function
(function ( ,ドル window, undefined ) {
doStuff();
})( jQuery, window );
The extra ()
at the end of the function, determines that it runs itself immediately.
First, we are creating a self-invoking anonymous function to shield ourselves from using global variables. We pass in ,ドル window, and undefined.
The arguments the self invoking function is called with are jQuery and window; nothing is passed in for undefined, so that if we decide to use the undefined keyword within the plugin, "undefined" actually will be undefined. This shields from other scripts potentially assigning a malicious value to undefined, such as true!
Now since ECMAScript 5 the "Immutable undefined" came along which is meant to protect you from exactly that. But as you can see from the answers to this recent question I asked myself, this is not the case yet.
$ is passed as jQuery; we do it this way to ensure that, outside of the anonymous function, $ can still refer to something else entirely, such as Prototype.
Passing the variable for the globally accessible window object allows for more compressed code through the minification processes (which you should be doing, as well).
(function(b,a,c){doStuff()})(jQuery,window); //Same function after being compressed.
Thus every time you refer to window
in your code, when compressed it can be replaced with a simple a
(or any other letter for that matter) and depending on how much you use it, will improve your performance.
Use-Strict Mode
You should try to understand the reason why a declaration is used and not simply because someone is telling you to. JSHint isn't really a bible you should follow to the death. I'm not saying you shouldn't use it (you probably should use it), I'm saying that it's a good idea to study the "hints" it's giving you, and determine whether or not to use them.
In this case I highly recomend that you do use the strict mode. It will many times force you to write better code if you understand how it works.
As Nicholas C. Zakas puts it:
"Strict mode makes a lot of changes to how JavaScript runs. The intent is to allow developers to opt-in to a "better" version of JavaScript."
Here is the link to his article which might help you understand. http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/
Here are a couple of things you might want to add to your JS/jQuery skills and comprehension of the same:
Self-invoking Anonymous Function
(function ( ,ドル window, undefined ) {
doStuff();
})( jQuery, window );
The extra ()
at the end of the function, determines that it runs itself immediately.
First, we are creating a self-invoking anonymous function to shield ourselves from using global variables. We pass in ,ドル window, and undefined.
The arguments the self invoking function is called with are jQuery and window; nothing is passed in for undefined, so that if we decide to use the undefined keyword within the plugin, "undefined" actually will be undefined. This shields from other scripts potentially assigning a malicious value to undefined, such as true!
Now since ECMAScript 5 the "Immutable undefined" came along which is meant to protect you from exactly that. But as you can see from the answers to this recent question I asked myself, this is not the case yet.
$ is passed as jQuery; we do it this way to ensure that, outside of the anonymous function, $ can still refer to something else entirely, such as Prototype.
Passing the variable for the globally accessible window object allows for more compressed code through the minification processes (which you should be doing, as well).
(function(b,a,c){doStuff()})(jQuery,window); //Same function after being compressed.
Thus every time you refer to window
in your code, when compressed it can be replaced with a simple a
(or any other letter for that matter) and depending on how much you use it, will improve your performance.
Use-Strict Mode
You should try to understand the reason why a declaration is used and not simply because someone is telling you to. JSHint isn't really a bible you should follow to the death. I'm not saying you shouldn't use it (you probably should use it), I'm saying that it's a good idea to study the "hints" it's giving you, and determine whether or not to use them.
In this case I highly recomend that you do use the strict mode. It will many times force you to write better code if you understand how it works.
As Nicholas C. Zakas puts it:
"Strict mode makes a lot of changes to how JavaScript runs. The intent is to allow developers to opt-in to a "better" version of JavaScript."
Here is the link to his article which might help you understand. http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/