JSFiddle - React, Tailwind, and code Playground
Javascript lesson 1
by Ryan Brown
JavaScript
/*
//simple alert calling predefined message.
var message = "Hello There";
alert(message);
//simple variables introduced, added, and alerted
//>>>Learn how to use html<<<<
var myNumber = 200;
var myAge = 23;
var fAge = myAge + 20;
alert("You will be " + fAge + "\nIn Twenty Years");
//if...else statement
var age = 37;
if (age < 35) {
alert("You're still young")
}
else {
alert("You're getting old")
}
//if statement with a preset boundary to create an alert
var tweetCount = 1;
if (tweetCount < 2) {
alert("You need to make some tweets")
}
//Arrays (a list of things)
//quick list
var myList = ["Eggs", " Milk"," Fruit"];
myList[0] = "Veggies"
myList[1] = " eggs"
myList[3] = "friends"
alert("Don't forget: " + myList)
alert(myList.length)//used to display length. current example has coffee console which shows results on input.
*/