Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Clear&Readable solution in Clear category for [old] First Word (simplified) by SaintDron
"use strict";
const firstWord = str => str.split(' ')[0];
var assert = require('assert');
if (!global.is_checking) {
console.log('Example:')
console.log(firstWord("Hello world"))
// These "asserts" using for self-checking and not for auto-testing
assert.equal(firstWord("Hello world"), "Hello")
assert.equal(firstWord("a word"), "a")
assert.equal(firstWord("hi"), "hi")
console.log("Coding complete? Click 'Check' to earn cool rewards!");
}
March 22, 2019
Comments: