Basic

beginner1 of 6

Learn about basic in fp-ts ord

Code Editor

01-basic.exercise.ts

💻
Loading editor...
Preparing Monaco Editor with TypeScript support

Test Results

Requirements

describe('Ord basic', () => {
  it('compares numbers', () => {
    expect(compareNumbers(5, 10)).toBeLessThan(0)
    expect(compareNumbers(10, 5)).toBeGreaterThan(0)
    expect(compareNumbers(5, 5)).toBe(0)
  })

  it('sorts words alphabetically', () => {
    const result = sortWords(['zebra', 'apple', 'banana'])
    expect(result).toEqual(['apple', 'banana', 'zebra'])
  })
})
🧪

Ready to Test?

Click "Run Tests" to see how your code performs

Pro Tips

💡 Stuck? Here's what to try:

  • • Read the comments in the code carefully
  • • Run tests frequently to get feedback
  • • Check the fp-ts documentation
  • • Use the solution if you need help

🚀 Learning Approach:

  • • Focus on understanding, not just solving
  • • Experiment with different approaches
  • • Think about real-world applications
  • • Build on previous exercises