Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] Three Words by 00trav
"use strict";
function threeWords(data) {
var tally = 0;
data = data.split(" ");
for(var i in data){
if(isNaN(data[i])){
tally++;
}
else
{
tally = 0;
}
if (tally == 3){
return true;
}
}
return false;
}
var assert = require('assert');
if (!global.is_checking) {
assert.equal(threeWords("Hello World hello"), true, "1st example");
assert.equal(threeWords("He is 123 man"), false, "2nd example");
assert.equal(threeWords("1 2 3 4"), false, "3rd example");
assert.equal(threeWords("bla bla bla bla"), true, "4th example");
assert.equal(threeWords("Hi"), false, "Letters");
console.log("Coding complete? Click 'Check' to review your tests and earn cool rewards!");
}
Nov. 17, 2016
Comments: