by Brendon Thiede
If you could program a robot to do one task for you, what would it be?
Time to get our starter code!

If you forked for a previous workshop, update it first:
git pull in your local folderSee the Setup Guide for details
git clone https://github.com/YOUR-USERNAME/workshops.git
cd workshops/
code .
This opens VS Code in the current folder
Open the integrated terminal (View → Terminal)
node --version
You should see v18 or higher!
cd javascript-basics/starter-code
node hello.js
You should see a welcome message!
If it works, you're ready to code!
It's one of the most popular programming languages
Node.js lets us run JavaScript outside the browser
Today we're using Node.js to keep things simple
Labeled boxes for storing information
To remember information and use it later!
Two keywords: let and const
const studentName = "Scooby";
let snacks = 7;
const - stays the same (constant)let - can change laterlet, const)
// Good names
let playerName = "Sam";
let currentScore = 100;
// Bad names
let x = "Sam"; // What is x?
let name = "Sam"; // Which name?
let my name = "Sam"; // Has a space!
Different kinds of information
Text wrapped in quotes
let greeting = "Hello, world!";
let name = "Scooby";
let story = 'Once upon a time...';
Use double quotes " " or single quotes ' '
No quotes needed!
let age = 13;
let score = 100;
let pi = 3.14;
Can do math with numbers!
True or false values
const isLearning = true;
const hasFinished = false;
const lovesJavaScript = true;
Great for yes/no questions!
Open story.js and create variables about yourself:
let myName = "put your name here";
let myAge = 0; // put your age
const isLearningJS = true;
Run it: node story.js
Seeing what your program is doing
let name = "Alex";
console.log(name);
Output:
Alex
console.log("Hello!");
console.log(42);
console.log(true);
Output:
Hello!
42
true
Joining strings together
Combines strings (and numbers)
let firstName = "Alex";
let lastName = "Smith";
console.log(firstName + " " + lastName);
Output:
Alex Smith
Don't forget the space!
let name = "Alex";
let age = 13;
console.log("My name is " + name);
console.log("I am " + age + " years old");
Output:
My name is Alex
I am 13 years old
// Without space
console.log("Hello" + name + "!");
// With space
console.log("Hello " + name + "!");
Always check your spacing!
Add to your story.js:
console.log("Hello, my name is " + myName);
console.log("I am " + myAge + " years old");
console.log("Am I learning JavaScript? " + isLearningJS);
Run it: node story.js
Stretch, move around, grab some water
Back in 10 minutes!
Create a dynamic story using variables!
const hero = "Captain Code";
let location = "Digital Forest";
let treasure = 0;
console.log(hero + " entered the " + location);
treasure = treasure + 5;
console.log("Found " + treasure + " gems!");
Open story.js - it has TODO comments to guide you!
Build your story step by step:
node story.jsEveryone makes mistakes - that's how we learn!
let to change valuesYour story is unique!
There's no "right" story - be creative!
The goal is to practice variables and console.log
Let's commit to Git!
git add .
git commit -m "Complete dynamic story"
git push
Now your work is saved on GitHub!
Who wants to share their story?
What surprised you about JavaScript?
What would you add to your story with more time?
Interactive HTML + JavaScript
Your code will respond to real button clicks!
Variables will store user input!
node