Skip to main content

Code Golf · #39 · 2026-05-13

camelCase to kebab-case

Difficulty 2/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 camelCase string (starts with lowercase), convert it to kebab-case.

Examples

f("helloWorld") hello-world
f("fooBarBaz") foo-bar-baz

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