예제
Read a price calculation in integer cents
입력
function total(cents,qty){return cents*qty;}Expected answer
function total(cents, qty) {
return cents * qty;
}Inspect a retry decision for HTTP 429
입력
if(status===429){retryAfter(30);}Expected answer
if (status === 429) {
retryAfter(30);
}Keep an escaped newline inside a JavaScript string
입력
var forecast="Rain\nSun";show(forecast);Expected answer
var forecast = "Rain\nSun";
show(forecast);Keep URL punctuation inside a quoted string
입력
var url="https://example.org/search?q=caf%C3%A9&limit=5";open(url);Expected answer
var url = "https://example.org/search?q=caf%C3%A9&limit=5";
open(url);Inspect a JSON round-trip without executing it
입력
function copy(value){return JSON.parse(JSON.stringify(value));}Expected answer
function copy(value) {
return JSON.parse(JSON.stringify(value));
}