|
93 | 93 | | 86 | [In how many ways we can make an object non-extensible](#86-in-how-many-ways-we-can-make-an-object-non-extensible) |
|
94 | 94 | | 87 | [What is object.freeze method](#87-what-is-objectfreeze-method) |
|
95 | 95 | | 88 | [What is object.seal method](#88-what-is-objectseal-method) |
|
| 96 | +| 89 | [How can you determine if JavaScript is disabled on a page](#89-how-can-you-determine-if-javascript-is-disabled-on-a-page) | |
| 97 | +| 90 | [How can you compare two date objects](#90-how-can-you-compare-two-date-objects) | |
96 | 98 |
|
97 | 99 | ### 1. What is JavaScript
|
98 | 100 | * JavaScript is a scripting language used to create dynamic and interactive websites. It is supported by all major web browsers.
|
@@ -1292,6 +1294,29 @@ console.log(obj); // output ========> { property1: "new value", property2: "val
|
1292 | 1294 |
|
1293 | 1295 | **[:top: Scroll to Top](#javascript-interview-questions)**
|
1294 | 1296 |
|
| 1297 | +### 89. How can you determine if JavaScript is disabled on a page |
| 1298 | +```<noscript>``` tag is used to determine if JavaScript is disabled on a page. It provides alternative content that should be displayed when JavaScript is not supported or disabled in the user's browser. |
| 1299 | +```js |
| 1300 | +<noscript> |
| 1301 | + <p>JavaScript is disabled in your browser.</p> |
| 1302 | +</noscript> |
| 1303 | +<script> |
| 1304 | + console.log("JavaScript is enabled on page"); |
| 1305 | +</script> |
| 1306 | +``` |
| 1307 | +**[:top: Scroll to Top](#javascript-interview-questions)** |
| 1308 | + |
| 1309 | +### 90. How can you compare two date objects |
| 1310 | +getTime() method is used to compare two date objects. |
| 1311 | +```js |
| 1312 | +let date1 = new Date(); |
| 1313 | +let date2 = new Date(date1); |
| 1314 | +console.log(date1.getTime() < date2.getTime()); // output ========> false |
| 1315 | +console.log(date1.getTime() > date2.getTime()); // output ========> false |
| 1316 | +console.log(date1.getTime() === date2.getTime()); // output ========> true |
| 1317 | +``` |
| 1318 | +**[:top: Scroll to Top](#javascript-interview-questions)** |
| 1319 | + |
1295 | 1320 | ## Output Based Questions
|
1296 | 1321 |
|
1297 | 1322 | **1. What will be the output**
|
|
0 commit comments