1. Which problems associated with using JavaScript, and are there JavaScript techniques that you discourage?

Browser version incompatibility is the biggest problem. It requires knowing how each scriptable browser version implements its object model. You see, the incompatibility rarely has to do with the core JavaScript language (although there have been improvements to the language over time); the bulk of incompatibility issues have to do with the object models that each browser version implements. For example, scripter who started out with Navigator 3 implemented the image rollover because it looked cool. But they were dismayed to find out that the image object wasn't scriptable in Internet Explorer 3 or Navigator 2. While there are easy workarounds to make this feature work on newer browsers without disturbing older ones, it was a painful learning EXPERIENCE for many.

The second biggest can of worms is scripting connections between multiple windows. A lot of scripter like to have little windows pop up with navigation bars or some such gizmos. But the object models, especially in the older browser versions, don't make it easy to work with these windows the minute you put a user in front of them--users who can manually close windows or change their stacking order. More recently, a glitch in some uninstall routines for Windows 95 applications can disturb vital parts of the system Registry that Internet Explorer 4 requires for managing multiple windows. A scripter can't work around this problem, because it's not possible to detect the problem in a us.

2. Where are the best JavaScript resources on the Web?

The Web has several FAQ areas on JavaScript. The best place to start is something called the meta-FAQ [14-Jan-2001 Editor's Note: I can't point to it anymore, it is broken!], which provides a high-level overview of the JavaScript help available on the Net. As for fact-filled FAQs, I recommend one maintained by Martin Webb and a mini-FAQ that I maintain.

For interactive help with specific problems, nothing beats the primary JavaScript Usenet newsgroup, comp.lang.javascript. Depending on my work backlog, I answer questions posted there from time to time. Netscape and Microsoft also have vendor-specific developer discussion groups as well as detailed documentation for the scripting and object model implementations.

3. How to create a new object in JavaScript?

Create a new object in JavaScript

var obj = new Object();
//or
var obj = {};

4. How to assign object properties?

obj["age"] = 17;
//or
obj.age = 17;

6. What does JavaScript null mean?

The null value is a unique value representing no value or no object.
It implies no object, or null string, no valid Boolean value, no number and no array object.

7. How you hide JavaScript code from old browsers that don't run it?

Use the below specified style of comments <script language=javascript> <!-- javascript code goes here // --> or Use the <NOSCRIPT>some html code </NOSCRIPT> tags and code the display html statements between these and this will appear on the page if the browser does not support JavaScript.

8. How you comment JavaScript code?

Use // for a single line comments in JavaScript and
/* start of Multiple lines comment in JavaScript

Multiple line comments in JavaScript
*/ for block comments in JavaScript

9. Tell me to put a "close window" link on a page?

<a href='javascript:window.close()' class='anyCSSClass'> Close </a>

10. What looping structures are there in JavaScript?

JavaScript supports the for loop, while loop, do-while loop, but there is no foreach loop in JavaScript.