JavaScript is a scripting language most often used for client-side web development.
What boolean operators does JavaScript support?
Answer
==
!=
<
>
<=
>=
Is a javascript script faster than an ASP script?
Answer
JSP is faster then ASP as the script is run on the client side. Only the computation is done on the server side.
What is == operator ?
Answer
The ‘==’ operator is a boolean comparison operator that returns true if the variables on its both sides are compared equal else it returns false.
What is negative infinity?
Answer
It’s a number that is obtained by dividing a negative number by zero. (in JSP)
What’s relationship between JavaScript and ECMAScript?
Answer
JavaScript is a scripting language most often used for client-side web development. It was the originating dialect of the ECMAScript standard. ECMAScript and LiveScript are other names for JavaScript. The current JavaScript that is supported in browsers is ECMAScript revision 3.
What does isNaN function do?
Answer
The isNaN function determines if the value is a number or not and depending upon the result, it returns true or false.
How to read and write a file using javascript?
There are two ways to do it:
1. Using JavaScript extensions (runs from JavaScript Editor), or
2. Using a web page and ActiveX objects (Internet Explorer only)
In JavaScript Extensions, you can use
fh = fopen(getScriptPath(), 0); to open a file
Using ActiveX objects, following should be included in your code to read a file:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.OpenTextFile("C:\\example.txt", 1, true);
How do you create a new object in JavaScript?
In order to generate dynamic content, JSP provides for creating, modifying and interacting with Java objects. The implicit objects like page, config, request, etc are called so because their availability in the in JSP page is automatic.
Also, along with using constructor functions (e.g. var mything = new myObject();), you can use Object Initializers to create objects in JSP.
E.g:
var myCar = {color:"white",wheels:4,engine:{cylinders:4,size:2.2}};
How to create arrays in JavaScript?
Although you can create the arrays using ‘new’ (var myArray = new myArray[10];), it is recommended that you create it in the following way: var myArray = [];
You don't need to tell Javascript how many items to size the Array for. Javascript automatically increases the size of the Array as needed.
No comments:
Post a Comment