Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions basicMath/MathUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ class MathUtilities {


add(baseValue, valueToAdd){
return -1;
return baseValue + valueToAdd;
}

subtract(baseValue, valueToAdd){
return -1;
return baseValue - valueToAdd;
}

divide(baseValue, valueToAdd){
return -1;
return baseValue / valueToAdd;
}

multiply(baseValue, valueToAdd){
return -1;
return baseValue * valueToAdd;
}
}

Expand Down
2 changes: 1 addition & 1 deletion basicMath/MathUtilities.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test("Test 2 Integer Division", () => {
let addedValue = 1;

// When
let expected = 127;
let expected = 2;
let actual = math.divide(baseValue, addedValue);
//Then
expect(actual).toEqual(expected);
Expand Down
22 changes: 13 additions & 9 deletions strangerStrings/StrangerStrings.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
class StrangerStrings {

getHelloWorld(){
return null;
return "Hello World";
}

concatenation(firstSegment, secondSegment){
return null;
return firstSegment.concat(secondSegment);
}

getPrefix(input){
return null;
return input.substring( 0, (input.length / 2) );
}

getSuffix(input){
return null;
return input.substring( (input.length / 2), ( input.length));
}

getMiddleCharacter(input){
return null;
return input[
input.length % 2 == 0 ? ( input.length / 2 ) : ( (input.length - 1) / 2 )
];
}

getFirstWord(input){
return null;
const arr = input.split(' ');
return arr[0];
}

getSecondWord(spaceDelimnatedInput){
return null;
getSecondWord(spaceDeliminatedInput){
const arr = spaceDeliminatedInput.split(' ');
return arr[1];
}

reverse(input){
return null;
return input.split('').reverse().join('');
}
}

Expand Down
2 changes: 1 addition & 1 deletion strangerStrings/StrangerStrings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ test("return the middle character of `inputValue`", () => {


// When
let actual = strangerStrings.getMiddleCharacter(input);
let actual = strangerStrings.getMiddleCharacter(inputValue);
//Then
expect(actual).toEqual(expected);
});
Expand Down