Skip to content

Commit 34d9aee

Browse files
committed
day 5 interview qustions js
1 parent 7b55f50 commit 34d9aee

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

JavaScript Interview/Day 5/demo.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
3+
When comparing a string to a number, JavaScript converts the string to a number.
4+
5+
" " (a single space) gets converted to 0 because it doesn't contain numeric characters but can be interpreted as zero when coerced.
6+
The comparison becomes:
7+
0 > -1, which is true.
8+
1.
9+
console.log(" ">-1)//true
10+
console.log(" ">" ")//false
11+
console.log(""==true)//false
12+
console.log("g ">"5")//true unicode value compares
13+
console.log(![]+[])//false
14+
15+
16+
17+
2.
18+
let a = {}
19+
let b = {key: "b"}
20+
let c = { key: "c" }
21+
a[b] = 100;
22+
a[c] = 200;
23+
console.log(a[b]) //200
24+
25+
26+
27+
3.A void element in HTML is an element that cannot have any child nodes, including text or other elements.
28+
29+
Example:
30+
<area> – Defines a clickable area inside an image map.
31+
<base> – Specifies the base URL for all relative URLs in a document.
32+
<br> – Inserts a line break.
33+
<col> – Specifies column properties for <colgroup>.
34+
<embed> – Embeds external content like media or plugins.
35+
<hr> – Represents a thematic break (horizontal rule).
36+
<img> – Embeds an image.
37+
<input> – Represents an input field.
38+
<link> – Specifies relationships between the current document and external resources.
39+
<meta> – Provides metadata about the document.
40+
<source> – Specifies media resources for <audio> and <video>.
41+
<track> – Specifies text tracks for <video> and <audio>.
42+
<wbr>
43+
44+
45+
4. The <select> element is used to create a drop-down list.
46+
47+
The <select> element is most often used in a form, to collect user input.
48+
49+
The <datalist> tag specifies a list of pre-defined options for an <input> element.
50+
*/
51+
52+

0 commit comments

Comments
 (0)