Essential JavaScript
Introduction
JavaScript Basics
Numbers
Strings
Logic
Variables
Loops
Objects
Arrays
Going Further
Essential JavaScript
Introduction
JavaScript Basics
Numbers
Strings
Logic
Variables
Loops
Objects
Arrays
Going Further
Sorting Shoes Kata
You are still working on your factory robot, teaching it how to compare items and sort them. Your next challenge is teaching your robot how to order things by number.
Your robot will look at two different shoe boxes and see the sizes on those shoe boxes. It needs to be able to tell if the first shoe size is greater than the second, less than the second, or equal to the second. It will then know where to stack the shoe boxes relative to each other.
Given the size of the first shoe (shoeSize1
) and the size of the second shoe (shoeSize2
), return "greater"
if the first size is greater than the second, "less"
if the first size is less than the second, and "equal"
if the two sizes are equal.
Code Editor
Click "Run Tests" to execute your function and see the test results below.
Test Results
Run your code to see test results
Console Output
0 output lines