Reverse

beginner3 of 6

Learn about reverse in fp-ts ord

Code Editor

03-reverse.exercise.ts

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

Test Results

Requirements

describe('Ord reverse', () => {
  it('sorts numbers descending', () => {
    const result = sortDescending([3, 1, 4, 1, 5, 9])
    expect(result).toEqual([9, 5, 4, 3, 1, 1])
  })

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

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