some javascript stuff

  1. What’s relationship between JavaScript and ECMAScript? – ECMAScript is yet another name for JavaScript (other names include LiveScript). The current JavaScript that you see supported in browsers is ECMAScript revision 3.
  2. What are JavaScript types? – Number, String, Boolean, Function, Object, Null, Undefined.
  3. How do you convert numbers between different bases in JavaScript? – Use the parseInt() function, that takes a string as the first parameter, and the base as a second parameter. So to convert hexadecimal 3F to decimal, use parseInt (“3F”, 16);
  4. What does isNaN function do? – Return true if the argument is not a number.
  5. What is negative infinity? – It’s a number in JavaScript, derived by dividing negative number by zero.
  6. What boolean operators does JavaScript support? – &&, || and !
  7. What does “1”+2+4 evaluate to? – Since 1 is a string, everything is a string, so the result is 124.
  8. How about 2+5+”8″? – Since 2 and 5 are integers, this is number arithmetic, since 8 is a string, it’s concatenation, so 78 is the result.
  9. What looping structures are there in JavaScript? – for, while, do-while loops, but no foreach.
  10. How do you create a new object in JavaScript? – var obj = new Object(); or var obj = {};
  11. How do you assign object properties? – obj[“age”] = 17 or obj.age = 17.
  12. What’s a way to append a value to an array? – arr[arr.length] = value;
  13. What is this keyword? – It refers to the current object.
Advertisements

4 Responses to “some javascript stuff”

  1. some javascript stuff « Tips & Tweaks By [ Genetic Vital ] Says:

    […] by geneticvital on November 27, 2007 Courtesy to Muhammad Adnan for providing us this Stuff https://interviewquestion.wordpress.com/2007/06/01/some-javascript-stuff/ […]

  2. ajay Says:

    i find u r site very good i m also building one site for asp.net if u want then i can add content add from u r site and get links back to u it is totally u r section in my website

  3. tmsnjhn Says:

    thanks for sharing, here are more topics
    http://jack-fx.com/csharp/post/aspnet-interview-questions-and-answers-csharp.htm
    http://jack-fx.com/csharp/post/38-interview-questions-and-answers-of-aspnet.htm
    http://jack-fx.com/csharp/post/c-interview-questions-and-answers.htm

  4. Administrator Says:

    great stuff Muhammad, and also meaningful. Keep it up!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: