Skip to main content

Code Golf · #29 · 2026-05-03

Roman numeral to integer

Difficulty 3/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 Roman numeral string (I, V, X, L, C, D, M), return the integer value.

Examples

f("XIV") 14
f("IX") 9

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