JavaScript is being popular day by day with the improvement of Ajax and Single Page Applications. It's the language of all web browsers. It's important to understand the basics of any programming language before use frameworks and libraries of that language. Then you can write efficient and more manageable codes easily. This slide set is prepared to give you a better understanding on JavaScript basics. Wish you all the best for better programming.
2. • Became more useful with the popularity of Ajax
• But adds a quite heavy load to the browser (Demo)
3. Variables
• Declared with ‘var’ keyword
• Type is resolved at runtime.You can assign any primitive type, function or object
to a variable.
• Scope of a public variable is the ‘window’ object
That means,
var a; or a; Ξ window.a; Ξ window[‘a’];
• Here is a description of all the predefined objects of Javascript
• Beware,This makes your variable public!
4. • You can have more OOP behavior with ‘new’ and ‘prototype’
5. • This comes only when ‘null’ is assigned as
the value (Commonly from Json with Ajax)
6. • You can assign ‘undefined’ value to a variable, if you want ;-)
I think this should have been the very first session of these tech talk series. Because without these fundamentals, there is no use of script frameworks. Your code is definitely messed up. You might think, Javascript is also like Java, C# or PHP. Not at all. Javascript is Javascript. It has both functional and OOP features. And it’s a scripting language, not a pre-compiled language like C#.
Just write $ = undefined; at the end of last script file. ORJust add an empty comment ( // ) line at the end of any script library. Bundling is finished! :D