Intermediate
A CSV cell that survives commas
csvCell(value) must make one safe CSV cell: empty for null, undefined and NaN; wrapped in quotes when it has a comma, a quote or a line break (inner quotes doubled); and prefixed with ' when a text starts with =.
Numbers stay as they are: -3 is -3.
What Check tests
- A plain text is unchanged
- A comma gets quotes
- A quote is doubled and wrapped
- A formula text gets a ' in front
- A negative number stays a number
- null and NaN are empty
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.