location

[URL]

  1. ] http://toys.usvsth3m.com/javascript-under-pressure/

[TEL]

[DIRECTIONS]

[REFERENCE]

// 1]  (something like) i will be an integer, double it and return ....????

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?
Details Photos Edit more

address

ID:377

Name: http://toys.usvsth3m.com/javascript-under-pre

Street:: 123 main street

Street::

City :: sites

State :: language-javascript

Country :: technology-developer-www

Postal :: n/a

STATUS: Go

PRIORITY: 0

OWNER ID: 75

DESCRIPTION: up to the challenge, this is a fun test , nice tool, write some js functions, with a timer going, see how long it take you to get through

Content Photos Edit more

photos

page_photo

actions

Call Location Email Location SMS Location Address Map

map