Вы находитесь на странице: 1из 4

1.

What is the difference between java and java


script...?
Java Script is object based language it is used for
front end validations
Java is object oriented language object oriented
language supports OOP's Object based not
supported inheritance.

2. What are JavaScript types?


Number, String, Boolean, Function, Object, Null,
Undefined.

3. What does is Nan function do?


Return true if the argument is not a number.

4. What is negative infinity?


It’s a number in JavaScript, derived by dividing
negative number by zero.

5. What Boolean operators does JavaScript


support?
&&, || and !

6. What looping structures are there in JavaScript?


For, while, do-while loops, but no for each.

7. How do you assign object properties?


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

8. What’s a way to append a value to an array?


arr[arr.length] = value;

9. What is this keyword?


It refers to the current object.

10. What is the main difference between Client


side JavaScript and and Server side Java Script.
How actually they run on both side with Example?
Client side JavaScript encompasses the core
language plus extras such as the predefined
objects, only relevant to running JavaScript in a
browser. The client side JavaScript is embedded
directly in the HTML pages and is interpreted by
the browser completely at the run time. Server side
JavaScript also encompasses the core language
plus extras as the predefined objects and functions
only relevant to running JavaScript in a server. The
server side java scripts are compiled before they
are deployed.

11. What’s relationship between JavaScript and


ECMAScript?
- ECMAScript is yet another name for JavaScript
(other names include Live Script). The current
JavaScript that you see supported in browsers is
ECMAScript revision 3.

12. What are JavaScript types?


- Number, String, Boolean, Function, Object, Null,
Undefined.
13. 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);

14.What does isNaN function do?


- Return true if the argument is not a number.

15. What is negative infinity?


- It’s a number in JavaScript, derived by dividing
negative number by zero.

16. What Boolean operators does JavaScript


support?
- &&, || and !

17. What do "1"+2+4 evaluate to?


- Since 1 is a string, everything is a string, so the
result is 124.

18. How about 2+5+"8"?


- Since 2 and 5 are integers, this is number
arithmetic, since 8 is a string, its concatenation, so
78 is the result.

19. What looping structures are there in JavaScript?


- For, while, do-while loops, but no for each.
20. How do you create a new object in JavaScript?
- var obj = new Object(); or var obj = {};

21.How do you assign object properties?


- obj["age"] = 17 or obj.age = 17.

22. What’s a way to append a value to an array?


- arr[arr.length] = value;

23. What is this keyword?


- It refers to the current object.

24. How do you create a new object in JavaScript?


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

25. 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);

26. What do "1"+2+4 evaluate to?


Since 1 is a string, everything is a string, so the
result is 124.

Вам также может понравиться