Code Golf · #60 · 2026-06-03
String length
Difficulty 1/3 · JavaScript
How to play
Write a JavaScript function body that passes all test cases using the fewest characters. Run against examples first, then submit for the full test suite. Eagle < Birdie < Par.
Given a string, return its length.
Examples
f("hello") → 5
f("") → 0
Loading your progress...
Your code (function body — receives input)
function(input) { 0 chars
}
Write the shortest JavaScript function body that passes all tests · Back to hub