Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Coding and/or kayaking probably

Travis Wimer traviswimer

💻
Coding and/or kayaking probably
View GitHub Profile
@traviswimer
traviswimer / PurposeOfFinally.js
Created Apr 24, 2013
The purpose of finally (as in try{ }finally{ })
View PurposeOfFinally.js
///////////////////////////////
// Why does `finally` exist? //
///////////////////////////////
try{
console.log("first");
return;
//this wont get called because of the return
console.log("second");
}finally{
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.foundFirstWall=false;
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
You can’t perform that action at this time.