Skip to content

#009 Less Than 100

Adam Kubiś edited this page Oct 28, 2026 · 1 revision

009 Less Than 100

Given two numbers, return true if the sum of both numbers is less than 100. Otherwise return false.

Current source and tests | Catalog | Testing and tooling

Run this solution

From the cloned repository root, after installing dependencies:

node "Edabit/009 Less Than 100.js"

Assertions are kept alongside the implementation and throw on failure. A successful run exits with code 0. Run every exercise with npm test or both lint and tests with npm run check.

Current implementation and tests

This is the complete executable file, including its imports and inline test cases. Run it from the repository, not as an isolated file copied out of the wiki. Line endings and trailing whitespace are normalized; executable tokens are unchanged.

//Given two numbers, return true if the sum of both numbers is less than 100. Otherwise return false.
function lessThan100(a, b) {
    return a+b < 100;
}
import * as Test from '../testHelper.js';
Test.assertEquals(lessThan100(5, 57), true)
Test.assertEquals(lessThan100(77, 30), false)
Test.assertEquals(lessThan100(0, 59), true)
Test.assertEquals(lessThan100(78, 35), false)
Test.assertEquals(lessThan100(63, 11), true)
Test.assertEquals(lessThan100(37, 99), false)
Test.assertEquals(lessThan100(52, 11), true)
Test.assertEquals(lessThan100(82, 95), false)
Test.assertEquals(lessThan100(17, 44), true)
Test.assertEquals(lessThan100(74, 53), false)
Test.assertEquals(lessThan100(3, 77), true)
Test.assertEquals(lessThan100(25, 80), false)
Test.assertEquals(lessThan100(59, 28), true)
Test.assertEquals(lessThan100(69, 87), false)
Test.assertEquals(lessThan100(10, 45), true)
Test.assertEquals(lessThan100(43, 58), false)
Test.assertEquals(lessThan100(50, 44), true)
Test.assertEquals(lessThan100(74, 89), false)
Test.assertEquals(lessThan100(3, 27), true)
Test.assertEquals(lessThan100(21, 79), false)

Clone this wiki locally