An open API service indexing awesome lists of open source software.

https://github.com/ruthmoog/makers_middle-character-js

solve the middle letter kata with TDD
https://github.com/ruthmoog/makers_middle-character-js

Last synced: 2 months ago
JSON representation

solve the middle letter kata with TDD

Awesome Lists containing this project

README

        

# Middle Character Kata

Challenge: return the middle character of a word. If the word's length is odd, return the middle character. If the word's length is even, return the middle 2 characters.

## Acceptance Criteria

- get_middle("test") # => "es"
- get_middle("testing") # => "t"
- get_middle("middle") # => "dd"
- get_middle("A") # => "A"
- get_middle("of") # => "of"

## Running the Program

The program runs in the browser console.
Open the `index.html` file in the browser then open the console in the developer tools.

## Approach

I used this kata to practise writing JavaScript and TDD with vanilla JS tests.