Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Goes Right After solution in Uncategorized category for Goes Right After by vvm70
"use strict";
function goesAfter(word: string, first: string, second: string): boolean {
return word.indexOf(first) < word.indexOf(second) && word.includes(first + second);
}
var assert = require('assert');
//if (!global.is_checking) {
console.log('Example:');
console.log(goesAfter('world', 'w', 'o'));
// These "asserts" are used for self-checking
assert.equal(goesAfter('world', 'w', 'o'), true);
assert.equal(goesAfter('world', 'w', 'r'), false);
assert.equal(goesAfter('world', 'l', 'o'), false);
assert.equal(goesAfter('panorama', 'a', 'n'), true);
assert.equal(goesAfter('list', 'l', 'o'), false);
assert.equal(goesAfter('', 'l', 'o'), false);
assert.equal(goesAfter('list', 'l', 'l'), false);
assert.equal(goesAfter('world', 'd', 'w'), false);
console.log("Coding complete? Click 'Check' to earn cool rewards!");
//}
June 17, 2020