Commit 1d2e8aca authored by Mike John Herter's avatar Mike John Herter

Delete checks_for_types_in_array.js

parent e6f31cf2
function areSameType(args) {
for (i = 0; i < args.length; i++) {
if (typeof (args[i]) !== typeof (args[i + 1])) {
return false
} else {
}
return true
}
}
console.log(areSameType(['hello', 'world', 'long sentence'])) // => true
console.log(areSameType([1, 2, 9, 10])) // => true
console.log(areSameType([['hello'], 'hello', ['bye']])) // => false
console.log(areSameType([['hello'], [1, 2, 3], [{ a: 2 }]])) // => true
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment