Principle of Programming

Heggy Castaneda
Jul 27, 2017 · 1 min read

Some notes I wrote while going thru principle of programming lab using Javascript

<!-- onload when website load it will do something --><body onload="">// JavaScript Document// when you don't assign value output: Nullvar myScore;// set up and change game scoreinit();// invoke the functionchangeScore();// function to initialize game scorefunction init() {myScore = 1000;}// function to change the score of the gamefunction changeScore() {// when myScore initially set to nothing is it NULL// before we run the init() function therefore, output// is NaN when running this function w/o running init()myScore = myScore + 100;console.log("Player score: " + myScore);}
Heggy Castaneda

Written by

like to build things

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade