A Pen by Machiko Yasuda on CodePen.
Created
August 29, 2013 01:09
-
-
Save machikoyasuda/6373231 to your computer and use it in GitHub Desktop.
A Pen by Machiko Yasuda.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// once we defined the function, it worked: | |
function myFunction() { } | |
try { | |
// test your function here | |
var n = 3; | |
if (n==4) { | |
document.write("N == 4.") | |
} | |
else { | |
throw("Not 4."); | |
} | |
// set condition for knowing try-block was satisfied | |
// document.write("This means the try block function ran."); | |
} catch(error){ | |
// if try does not work, catch the error here. | |
document.write("This means we made it to the exception." + error); | |
} finally { | |
// alert, console.log, alerts | |
document.write(" This is the end."); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: Helvetica; | |
font-size: 14px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment