edit-location
Home
Up
Delete
Location Name:
Location 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
Sector ID:
Status:
Go
Going
Been
Add Photo:
Street Address Line1:
Street Address Line2:
Country:
State:
City:
Postal or Zip Code:
Owner ID:
Content:
use HTML
Edit Content
<h2>[URL]</h2> <ol> <li>] http://toys.usvsth3m.com/javascript-under-pressure/</li> </ol> <h2>[TEL]</h2> <div><ol> <li>] </li> </ol> <h2>[DIRECTIONS]</h2> <div><ol> <li>] </li> </ol></div> <h2>[REFERENCE]</h2> <ol> <li>] </li> </ol> <h3><strong>// 1] (something like) i will be an integer, double it and return ....????</strong></h3> </div> <div> <div>return i*2 // FAIL b/c</div> <div> <h3><strong>// 2] i will be an integer. Return true if it's even, and false if it isn't.</strong></h3> </div> <div>function isNumberEven(i) { </div> <div> </div> <div> if(i % 2 === 0){</div> <div> return true;</div> <div> }</div> <div> else{</div> <div> return false;</div> <div> }</div> <div>}</div> <div> </div> <h3><strong>// 3 ]</strong> 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 </h3> <div><strong>// this = 21 minutes ttl = 30 minutes</strong></div> <div>// A FAIL</div> <div>function getFileExtension(i) {</div> <div> var substr = i.substring(i.length-4,i.length) ; </div> <div> if ( substr.charAt(0)==='.'){</div> <div> return substr.substring(substr.length-3,substr.length);</div> <div> }</div> <div> else{</div> <div> return false;</div> <div> }</div> <div>}</div> <div>// B</div> <div>function getFileExtension(i) { </div> <div> var substr = i.split('.') ;</div> <div> if ( substr[1]){</div> <div> return substr[1];</div> <div> }</div> <div> else{</div> <div> return false;</div> <div> }</div> <div>}</div> <div>SUCCESS! All tests passed. You've used 30:24 so far. Well done!</div> <div>Top work, that was tricky. Two challenges left! Ready to start the clock again?</div> </div>