Monday, January 6, 2014

Staying Frosty!

        So, the weather decided to be redonkulous today. In Texas, 33 degrees Fahrenheit is crazy cold even when there's no wind, but I got out of the house and game to my coffee shop to get my coffee on and some code done!
 I thought I'd start with some links that I found and/or were shared with me on G+:
link one:
http://www.christopherbiscardi.com/2014/01/06/flattening-nested-arrays-in-javascript/
I'm not COMPLETELY sure how this will be applied to me, but I've got some stuff that I'm working on that I think could be aided by this.
Also this:
http://www.javaworld.com/article/2078724/mobile-java/10-steps-to-becoming-the-developer-everyone-wants.html
The bullet points were enough for me, but read the definitions if you're crazy like that.

So, now down to business. I'm playing a Chris Cornell album called Carry On. I love the songs on here. A few covers, but they're decent.
Today's lesson starts off with MOAR conditionals.
var legalDrivingAge = 18;
var canIDrive =
  // write if else statement here. Return true or false
Have to make it return true or false if they can drive. This'll be easy. The next one will probably be crazy insane. That's how they do it. 
Turns out this was the crazy insane one. T`hose tricky bastards.
Also, what the hell does 
"Expected an identifier and instead saw ';'
missing semi colon."
Mean?? That's contradictory!
Side note:
doing my studies at a coffee shop is interesting in that I will occasionally glance around whilst sipping my latté (could actually afford one today! XD) and I'll be like; woah. those people weren't here a second ago. wait, it's been an hour?? haha!! 
// Define the function under this line
var canIdrive=function(myAge,legalDrivingAge){
 if(myAge>=legalDrivingAge){
     return true;
 }else{
     return false;
 }
};

// Declare legalDrivingAge under myAge
var myAge = prompt("How old are you?");
var legalDrivingAge=18;

//Create an if else statement using the function as a condition
if (myAge>=legalDrivingAge===true) {
  console.log("You can legally drive!");
}else {
  console.log("You'll have to wait a few more years!");
}
see that first 'var'?
yeah it just took me twenty minutes and a few WTFs to figure out that I missed that in my code...
Yup. Every coder person does that. well that was forever! 
see y'all wednesday!
--Martin

No comments:

Post a Comment