Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Between Markers solution in Uncategorized category for Between Markers (simplified) by Elena_Korljukova
import assert from "assert";
var betweenMarkers = (line, left, right) => line.slice(line.indexOf(left) + 1, line.indexOf(right))
console.log('Example:');
console.log(betweenMarkers('What is >apple<', '>', '<'));
// These "asserts" are used for self-checking
assert.equal(betweenMarkers('What is >apple<', '>', '<'), 'apple');
assert.equal(betweenMarkers('What is [apple]', '[', ']'), 'apple');
assert.equal(betweenMarkers('What is ><', '>', '<'), '');
assert.equal(betweenMarkers('[an apple]', '[', ']'), 'an apple');
console.log("Coding complete? Click 'Check' to earn cool rewards!");
June 10, 2020