File tree 3 files changed +49
-0
lines changed 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "exercise" : " reverse-string" ,
3
+ "version" : " 1.0.0" ,
4
+ "comments" : [
5
+ " If property based testing tools are available, a good property to test is reversing a string twice: reverse(reverse(string)) == string"
6
+ ],
7
+ "cases" : [
8
+ {
9
+ "description" : " empty string" ,
10
+ "property" : " reverse" ,
11
+ "input" : " " ,
12
+ "expected" : " "
13
+ },
14
+ {
15
+ "description" : " a word" ,
16
+ "property" : " reverse" ,
17
+ "input" : " robot" ,
18
+ "expected" : " tobor"
19
+ },
20
+ {
21
+ "description" : " a capitalized word" ,
22
+ "property" : " reverse" ,
23
+ "input" : " Ramen" ,
24
+ "expected" : " nemaR"
25
+ },
26
+ {
27
+ "description" : " a sentence with punctuation" ,
28
+ "property" : " reverse" ,
29
+ "input" : " I'm hungry!" ,
30
+ "expected" : " !yrgnuh m'I"
31
+ },
32
+ {
33
+ "description" : " a palindrome" ,
34
+ "property" : " reverse" ,
35
+ "input" : " racecar" ,
36
+ "expected" : " racecar"
37
+ }
38
+ ]
39
+ }
Original file line number Diff line number Diff line change
1
+ Reverse a string
2
+
3
+ For example:
4
+ input: "cool"
5
+ output: "looc"
Original file line number Diff line number Diff line change
1
+ ---
2
+ blurb : " Reverse a string"
3
+ title : " reverse-string"
4
+ source : " Introductory challenge to reverse an input string"
5
+ source_url : " https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb"
You can’t perform that action at this time.
0 commit comments