Beginner JavaScript · 30-minute coaching session
Is this call long enough?
One input. One rule. One decision. Build a small duration check from a blank file, then prove it works at the boundary.

Checking sign-in and saved work…
Sign in to save to your profileSign in to save your code, predictions, observations and explanations to your account across devices. Signed-out practice stays in this browser only. You can reset the editor after confirmation without erasing your written notes.
A different account copy exists. Choose which code and notes to keep.
1 · Try first · 5 minutes
Your goal in plain English
A call must last at least 30 seconds to continue. Take one duration, turn it into a number, and print whether the call can continue. Exactly 30 seconds counts.
Try on your own for a minute or two before opening a hint. Use invented data only. This editor runs practice JavaScript, with no connection to a live workflow.
- Declare
inputwith a starting value of32. - Declare
durationSecondsto hold the result ofNumber(input). - Declare
proceedand comparedurationSecondsto30. If it is 30 seconds or more, the result should betrue. Otherwise, it should befalse. - Print
durationSecondsto the console usingconsole.log. - Print
proceedto the console using a separateconsole.log, so the two values appear on separate lines.
Use let or const. Comments are welcome, but are not required to pass. Keep the three variable names so the practice inputs can find your code.
EDIT JAVASCRIPT
CONSOLE OUTPUT
Predict the result, then choose Run code.
Loading the editor…
Replace this editor’s code with its starting example?
Available after a passing check or three unsuccessful checks. Hints are available now.
Editor and console stay together. Drag their divider, or focus it and press the arrow keys, to change their widths. On phones the console sits below the editor.
2 · Predict, run, explain · 10 minutes
Test the same code eight ways
Choose Run this input to open a focused window. Predict the converted number and true-or-false decision, inspect your code with that input, then choose Run. Your prediction and actual console output are applied to the row automatically.
These buttons run a temporary copy of your current code with only the starting input changed. They do not replace or reset the code in your editor. Blank means empty text, "", in this lesson.
| Input | My prediction | Run current code | What I saw |
|---|---|---|---|
| 0 | Predict before running. | ||
| 2 | Predict before running. | ||
| 29 | Predict before running. | ||
| 30 | Predict before running. | ||
| 32 | Predict before running. | ||
| 49 | Predict before running. | ||
| Blank (empty text) | Predict before running. | ||
| "45" (text) | Predict before running. |
When you have tried the rows, use Check challenge by the editor. It checks your conversion, the comparison, these eight inputs and one invalid-text input. Passing checks validate this small task, not every possible webhook value.
3 · Learn after trying · 10 minutes
What happens between input and decision?
Use the diagram to connect the input, conversion and decision. Predict first, then reveal the path.
Number(): convert a value
Number("45") returns the number 45. Quotes tell us the original value was text. Number(32) stays the number 32. Number("") returns 0, not NaN.
NaN: conversion did not produce a usable number
Number("hello") returns NaN, short for “Not a Number.” NaN >= 30 is false. Add an extra row in your conversation: what would your code print for "hello"?
>= 30: include the boundary
29 >= 30 is false. 30 >= 30 is true. Read the symbol as “greater than or equal to,” or “at least.” Using > alone would reject exactly 30.
Connect this to a rejection check
Your working comparison answers, “May this duration continue?” A rejection condition can ask the opposite using !(durationSeconds >= 30). Work from the inside out: compare first, then flip the boolean with !. This catches both short durations and NaN for this exercise. durationSeconds < 30 alone does not catch NaN.
Number.isFinite("45") is false because it checks the supplied value without converting it. Number.isFinite(Number("45")) is true. A production validator should explicitly decide which incoming types and missing values are allowed.
4 · Explain it back · 5 minutes
You are the developer now
Explain your code aloud before typing notes. Your coach can listen for the parts you can explain independently.
Common mistakes: using > instead of >=, assuming blank becomes NaN, and confusing conversion with a check of the original value. A passing duration does not prove that a call was answered or that its content is useful.