FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScript-Equality-Table/index.html at master · armandodeleon/JavaScript-Equality-Table · GitHub
armandodeleon
/
JavaScript-Equality-Table
Public
forked from
dorey/JavaScript-Equality-Table
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScript-Equality-Table
/
index.html
Copy path
More file actions
More file actions
Latest commit
History
History
History
80 lines (70 loc) · 2.51 KB
Breadcrumbs
JavaScript-Equality-Table
/
index.html
Copy path
File metadata and controls
80 lines (70 loc) · 2.51 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
>
<
html
lang
="
en
"
>
<
head
>
<
meta
http-equiv
="
Content-Type
"
content
="
text/html; charset=utf-8
"
>
<
title
>
JS Comparison Table
</
title
>
<
link
rel
="
stylesheet
"
href
="
styles/simple.css
"
type
="
text/css
"
media
="
all
"
title
="
simple
"
charset
="
utf-8
"
>
<
script
src
="
https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js
"
type
="
text/javascript
"
charset
="
utf-8
"
>
</
script
>
<
script
src
="
https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js
"
type
="
text/javascript
"
charset
="
utf-8
"
>
</
script
>
<
script
type
="
text/javascript
"
src
="
js/comparison_table.js
"
>
</
script
>
<!-- Originally from here:
http://blog.codekills.net/archives/89-Equality-in-JavaScript.html
2013-Nov-11. Correcting issue where "[]===[]" was incorrectly marked as true.
Converted from this gist:
https://gist.github.com/761080
-->
</
head
>
<
body
>
<
div
id
="
tabs
"
>
<
ul
>
<
li
>
<
a
href
="
#two-equals
"
>
==
</
a
>
</
li
>
<
li
>
<
a
href
="
#three-equals
"
>
===
</
a
>
</
li
>
<
li
>
<
a
href
="
#if-statement
"
>
If()
</
a
>
</
li
>
</
ul
>
<
div
id
="
two-equals
"
>
<
h2
>
==
<
smaller
>
(negated: !=)
</
smaller
>
</
h2
>
<
p
class
="
description
"
>
When using two equals signs for JavaScript equality testing, some funky conversions take place.
</
p
>
</
div
>
<
div
id
="
three-equals
"
>
<
h2
>
===
<
smaller
>
(negated: !==)
</
smaller
>
</
h2
>
<
p
class
="
description
"
>
When using three equals signs for JavaScript equality testing, everything is
<
b
>
as is
</
b
>
. Nothing gets converted before being evaluated.
</
p
>
</
div
>
<
div
id
="
if-statement
"
>
<
h2
>
A standard IF statement. If(
<
i
>
value
</
i
>
) {/*- green -*/} else { /*- white -*/ }
</
h2
>
<
p
>
Note: This row does not match up with any of the rows in the other table.
</
p
>
</
div
>
<
div
style
="
padding: 2px 20px
"
>
<
h4
>
Moral of the story:
</
h4
>
<
p
>
Always use 3 equals unless you have a good reason to use 2.
</
p
>
</
div
>
</
div
>
<!-- see values.js for a list of values which are compared in the table -->
<
script
src
="
values.js
"
type
="
text/javascript
"
charset
="
utf-8
"
>
</
script
>
<
script
type
="
text/javascript
"
charset
="
utf-8
"
>
buildComparisonTable
(
values
,
"=="
)
.
appendTo
(
"#two-equals"
)
buildComparisonTable
(
values
,
"==="
)
.
appendTo
(
"#three-equals"
)
buildComparisonTableForIf
(
values
)
.
appendTo
(
"#if-statement"
)
$
(
'#tabs'
)
.
tabs
(
)
;
$
(
"<li><a href='unified/'>New link: view everything in one table</a></li>"
)
.
appendTo
(
"#tabs ul"
)
;
</
script
>
</
body
>
</
html
>
Back
|
FazBrowse Home
|
New Git URL