Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Goes Right After by mortonfox
"use strict";
function goesAfter(word: string, first: string, second: string): boolean {
return word.includes(first) && word.indexOf(first) + 1 === word.indexOf(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!");
// }
May 15, 2020