Katemonkey (In Most Places)

JavaScript Programming Fundamentals, Day 2 – Finally, Some JavaScript

After a day of repeating the basics of HTML and CSS, I'm finally actually getting into JavaScript.

I have been an absolute stubborn old mule when it comes to JavaScript. Completely. Because I keep on seeing it being used so much, and I'm like "Really? Does this really need to happen? Why are we doing this again?"

I'm sure it can be used for good. Otherwise, people I respect wouldn't be using it.

But, man, it is going to be tough to get me out of my fossilised habits. So here's hoping 37 videos of "Introduction To JavaScript" will put a few cracks in my stone facade.

03 — Introduction To JavaScript.

This entire course has it as Javascript. No capital S. But that fossilisation has set in and by gawd, there's an S in it.

It's a bunch of short videos, and it's supposed to be, like, "JavaScript in an hour", but I know it's going to take me longer than that, so I'm going to break it up where it seems appropriate.

01 — Variables

Wow, just jump straight into variables, huh? No explanations of what you're actually learning, no going through the details of JSBin, just straight into

var myString

It all seems very wishy-washy. Like "You can use Camel Case or you can use Snake Case and you can use semi-colons or you can leave them off and you can have a variable be in single quotes or double quotes or any type of number whatever".

Like, I don't expect a rigid canon, but man, this instructor is making it sound like nothing matters. It doesn't help that he also sounds like he doesn't care.

(I can believe nothing matters in JavaScript. Lord knows people code like that.)

But, okay, variables. Those I get. And concatenate. Yay.

getElementByID is also fine, but innerHTML kinda sets my hackles up a bit.

But, fine, okay, here we go.

Here are my variables.

var courseWork = "JavaScript";
var course_work = "HTML";
var courseNumber = 38;

Here is my HTML

<!DOCTYPE html>
<html>
<body>
  <p id="output"></p>
</body>
</html>

Here is my document:

document.getElementById("output").innerHTML = 
courseWork + " " + course_work + " " + courseNumber;

The instructor didn't include the " " bit. I added that in, because I know things.

02 — JavaScript

I thought these were out of order, because why would you be going straight into Variables when there's JavaScript?

But it turns out that this is actually Strings.

Okay, strings. Got it. Just like variables, but longer.

And this is when I discover that there are no course files to copy if something goes wrong, so when my initial strings didn't display, I had to go back to my variables and then add more words so they became strings.

Do I know why they didn't work? No. Will I ever? I honestly do not know.

But I know these work.

var learning = "You are learning JavaScript!";
var learnding = "Aren't you excited?";

I also now know how to turn a string into upper case or lower case. Which is actually kind of funny, because when I do:

document.getElementById("output").innerHTML = 
learning + " " + learnding.toUpperCase();

I get:

You are learning JavaScript! AREN'T YOU EXCITED?

No.

It then goes into how you can check to see if strings have certain words in or starts with, which is good, but I feel like this should be somewhere else in the course. I don't know.

.replace also brings comedy value.

document.getElementById("output").innerHTML = 
learning + " " + learnding.replace("excited","bored");

Yes.

After showing off strings, he suddenly jumps into arrays, which makes me wonder what on earth the later Arrays video is going to have.

But, hey, I do love arrays.

var learningArray = ["David Lynch","David Cronenberg","Guillermo del Toro"];
document.getElementById("output").innerHTML = learningArray;

That does produce the result of

David Lynch,David Cronenberg,Guillermo del Toro

So I wonder if I have to include the spaces in an array. Eh, they'll probably explain that later. I hope.

He's also splitting up arrays, which I really think is something that should have been covered later, but, okay.

learningArray = learning.split(" ")

Results in

You,are,learning,JavaScript!

03 — Numbers

So this is basic math stuff, with all the things I learned in the "Number Doctor" Python bit.

I may have made fun of how that instructor did stuff, but this guy? Doesn't explain a thing. Just goes "multiplication, addition, strings, something".

Although showing me that:

var str = "this is a string" + 5 + 4;

is different than:

var str = 5 + 4 + "this is a string"

is interesting. The first gets you:

this is a string54

And the second gets you:

9this is a string

Huh. Neat.

Day 2 — Results

I was going to do a lot more than just these first three, but it turns out that he's including a lot more than I thought he would. Add to it that there's no real way for me to figure out what I've broken except to slowly work it out myself, and...yeah. My brain. It's not as good as it once was.

So maybe I'll just do three at a time. It'll take longer, but at least I won't start flipping tables or anything.

Today's Sticker

A sticker with black text on a purple background that says "There's no turning back now..." which is from Disneyland's The Haunted Mansion.

Part of a random set of Haunted Mansion knock-off stickers I got somewhere. I feel it's appropriate for learning JavaScript, because THERE'S NO TURNING BACK NOW.

#kate learns javascript #kate learns web development #programming