Doubtly
@Doubtly · Joined Feb 2021
- Answers
- 3,792
- Questions
- 4,963
- Upvotes received
- 429
- How to detect the operating system on the client machine? Answer: Read the browser's navigator object, mainly navigator.userAgent (or navigator.platform), and check it for OS names. let ua = navigat... 1
- Difference between “==” and “===”? “==” checks only for equality in value, whereas “===” is a stricter equality test and returns false if either the value or the type of the t... 1
- How can you convert the string of any base to an integer in JavaScript? The parseInt() function is used to convert numbers between different bases. parseInt() takes the string to be converted as its first paramet... 1
- What is called Variable typing in Javascript? Variable typing is used to assign a number to a variable. The same variable can be assigned to a string. Example: i = 10; i = "string;" This... 1
- What are all the looping structures in JavaScript? Following are looping structures in Javascript: For While Do-while loops 1
- How to read and write a file using JavaScript? There are two ways to read and write a file using JavaScript Using JavaScript extensions Using a web page and Active X objects 2
- How can the style/class of an element be changed? It can be done in the following way: document.getElementById("myText"). style. fontSize = "20"; or document. getElementById ("myText"). clas... 1
- Does JavaScript support automatic type conversion? Yes, JavaScript does support automatic type conversion. It is the common way of type conversion used by JavaScript developers 1
- How you can submit a form using JavaScript? Answer: Get the form element and call its submit() method (or requestSubmit()). <form id="myForm" action="/save" method="post"> <input type=... 1
- What is === operator? === is called a strict equality operator, which returns true when the two operands have the same value without conversion. 1
- What is the difference between ViewState and SessionState? Answer: ViewState stores data for one page across its postbacks, on the client side; SessionState stores data for one user across all pages,... 1
- Which symbol is used for comments in Javascript? // for Single line comments and /* Multi Line Comment */ 2
- What is the working of timers in JavaScript? Timers are used to execute a piece of code at a set time or repeat the code in a given interval. This is done by using the functions setTime... 1
- What is ‘this’ keyword in JavaScript? ‘This’ keyword refers to the object from where it was called. 2
- What is a prompt box? A prompt box is a box that allows the user to enter input by providing a text box. A label and box will be provided to enter the text or num... 1
- Write the code for adding new elements dynamically? <html> <head> <title>t1</title> <script type="text/javascript"> function addNode() {var newP = document.createElement("p"); var textNode = d... 2
- What are undeclared and undefined variables? Undeclared variables are those that do not exist in a program and are not declared. If the program tries to read the value of an undeclared... 1
- Which company developed JavaScript? Netscape is the software company that developed JavaScript. 2