Skip to content

Commit b6936df

Browse files
committed
feature: add user-friendly explanations
1 parent 31a51b4 commit b6936df

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@
1414
<form class="container mt-2">
1515
<h2>JavaScript Loose Equals</h2>
1616
<h5 class="text-muted">JavaScript == Comparison Tool</h5>
17-
<div class="mt-5 mb-5">
17+
<div class="mt-4 mb-4">
18+
<div class="alert alert-info">
19+
<strong>💡 How it works:</strong> JavaScript's loose equality (<code>==</code>) performs type coercion, leading to surprising results.
20+
Enter any JavaScript expression below to see what other values are loosely equal to it!
21+
</div>
22+
1823
<div class="mb-3">
1924
<label for="input" class="form-label mb-2">
2025
<code>const x =</code>
2126
</label>
2227
<div class="d-flex gap-2">
23-
<textarea id="input" class="form-control flex-grow-1" rows="3" placeholder="Complete assignment by providing a right-hand side expression such as false." aria-label="JavaScript expression to evaluate">false</textarea>
28+
<textarea id="input" class="form-control flex-grow-1" rows="3" placeholder="Try: false, 0, '', [], null, undefined, '1', [1], or even complex expressions!" aria-label="JavaScript expression to evaluate">false</textarea>
2429
<button type="button" id="run" class="btn btn-primary" aria-describedby="input-help">
2530
<span class="button-text">Give examples</span>
2631
<span class="spinner-border spinner-border-sm d-none" role="status" aria-hidden="true"></span>

0 commit comments

Comments
 (0)