- if you assign a value to variable that has not yet been declared, the variable will automatically be declared as a GLOBAL variable.
This statement: carname="Volvo";will declare the variable carname as a global variable , even if it is executed inside a function.(http://w3schools.com/js/js_functions.asp)
- Never use document.write() after the document is loaded. It will overwrite the document.(http://w3schools.com/js/js_htmldom_html.asp)
- Infinity is a number (typeof(Infinity) returns a number)(http://w3schools.com/js/js_obj_number.asp)
- The information from the navigator object can often be misleading, and should not be used to detect browser versions . Since the navigator object can be misleading about browser detection, using object detection can be used to sniff out different browsers.(http://w3schools.com/js/js_window_navigator.asp)
- To display line breaks inside a popup box, use a back-slash followed by the character n.
example: alert("HellonHow are you?"); (http://w3schools.com/js/js_popup.asp)