git --version
sudo dnf install git-all
Or, if you are on a debian based distribution, like Ubuntu:
sudo apt-get install git-all
cd Desktop
git clone https://github.com/mrcolo/techLab.git
If this is your first attempt with Javascript, welcome! Try to run this snippet and play with it, by changing the values of a and b.
In here, we are initializing two variables, a and b. To do this, we use the syntax:
var a = 1
A ''var'' can be anything. Let's define a few types.
This is a number.
var 👹 = 4
This is a number with a floating point.
var 🤕 = 4.567
This is a string.
var 👻 = "Hello techLab"
Now we can start playing with Javascript. Try to edit this snippet to use mathematical operations , such as multiplication, division, or subtraction, to compute stuff out.
A condition allows us to check whether an expression is true, or false. Let's see a basic example:
Try to edit this snippet to make it evaluate the two numbers as equal!
An object has many categories that we can access to. Think about it as a car. A car is formed by a bunch of things, such as engine, wheels, and so on. Here's what an object looks like in JS:
Now, what if you bought a Yoga Subscription? Try to change the object's name and categories (such as Subscription or Address)to make it look like a Yoga Subscription Object!
With Javascript, we can interact with the web. Here's an example:
This is how alerts work. We are gonna use them, so you should probably get the gist of it. Also! They are gonna look a bit different depending on your favorite browser.
Try to play with the snippet to display a different alert. Remember, you can display everything, from numbers to strings. Wait. What if you wanted to use an object?
Javascript knows exactly what time it is. You just have to know how to ask him, or her, or non-gender conforming computer, how to.
This is what we learnt, so far, today.
var myAwesomeString = "Thanks for being here, Lancers 👨🏻🚀 "
if(thisIsTrue)
{console.log("This works!")}
var myAwesomeObject = {isThisOver: true}
var date = new Date()
alert(date)
Create a Celsius to Fahreneit converter. Display the result on an alarm that tells the current time too.