| JavaScript question answers 281-300 | JavaScript question answers 321-340 | |
JavaScript Question Answers - 301-320 |
date.valueOf()
var, let, or const
- Using object literal: var obj = {};
- Using constructor: var obj = new Object();
- Using class: class MyClass {} let obj = new MyClass();
Variable typing means a variable can hold values of different types at different times. Example:
var x = 10; x = "hello";
It is the dynamic assignment of types to variables depending on the value assigned at runtime.
void(0) is used to prevent the browser from refreshing or navigating when a link is clicked. Example:
<a href="javascript:void(0);">Click</a>
while (condition) { ... }
Yes, JavaScript is case sensitive. Example:
var name = "John"; and var Name = "Doe"; are two different variables.
str.valueOf()
arr.toString()
num.toString()
date.toString()
date.toTimeString()
str.toUpperCase()
date.toUTCString()
str.trim()
catch (error) { ... }
try, catch, finally, throw
arr.unshift(element1, element2, ...)
document.forms["formName"].submit(); or document.getElementById("formId").submit();
| JavaScript question answers 281-300 | JavaScript question answers 321-340 | |