return i*2 // FAIL b/c
// 2] i will be an integer. Return true if it's even, and false if it isn't.
function isNumberEven(i) {
if(i % 2 === 0){
return true;
}
else{
return false;
}
}
// 3 ] i will be a string representing filename, it may or may not have a file extension, if it does, return the extension name without the dot if it has one, or false if it does not
// this = 21 minutes ttl = 30 minutes
// A FAIL
function getFileExtension(i) {
var substr = i.substring(i.length-4,i.length) ;
if ( substr.charAt(0)==='.'){
return substr.substring(substr.length-3,substr.length);
}
else{
return false;
}
}
// B
function getFileExtension(i) {
var substr = i.split('.') ;
if ( substr[1]){
return substr[1];
}
else{
return false;
}
}
SUCCESS! All tests passed. You've used 30:24 so far. Well done!
Top work, that was tricky. Two challenges left! Ready to start the clock again?