Skip to content

Commit 13a14e1

Browse files
committed
String tests passing
1 parent 6afe608 commit 13a14e1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

topics/about_strings.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@ $(document).ready(function(){
66
test("delimiters", function() {
77
var singleQuotedString = 'apple';
88
var doubleQuotedString = "apple";
9-
equals(singleQuotedString === doubleQuotedString, __, 'are the two strings equal?');
9+
equals(singleQuotedString === doubleQuotedString, true, 'are the two strings equal?');
1010
});
1111

1212
test("concatenation", function() {
1313
var fruit = "apple";
1414
var dish = "pie";
15-
equals(fruit + " " + dish, __, 'what is the value of fruit + " " + dish?');
15+
equals(fruit + " " + dish, "apple pie", 'what is the value of fruit + " " + dish?');
1616
});
1717

1818
test("character Type", function() {
1919
var characterType = typeof("Amory".charAt(1)); // typeof will be explained in about reflection
20-
equals(characterType, __, 'Javascript has no character type');
20+
equals(characterType, "string", 'Javascript has no character type');
2121
});
2222

2323
test("escape character", function() {
2424
var stringWithAnEscapedCharacter = "\u0041pple";
25-
equals(stringWithAnEscapedCharacter, __, 'what is the value of stringWithAnEscapedCharacter?');
25+
equals(stringWithAnEscapedCharacter, "Apple", 'what is the value of stringWithAnEscapedCharacter?');
2626
});
2727

2828
test("string.length", function() {
2929
var fruit = "apple";
30-
equals(fruit.length, __, 'what is the value of fruit.length?');
30+
equals(fruit.length, 5, 'what is the value of fruit.length?');
3131
});
3232

3333
test("slice", function() {
3434
var fruit = "apple pie";
35-
equals(fruit.slice(0,5), __, 'what is the value of fruit.slice(0,5)?');
35+
equals(fruit.slice(0,5), "apple", 'what is the value of fruit.slice(0,5)?');
3636
});
3737

3838
});

0 commit comments

Comments
 (0)