techLab - 1st Lesson


Install Git and download our Repo!

  1. Go to your terminal (On Windows, it's called Command Prompt) and type:
    • Mac
    • git --version
    • Linux
    • sudo dnf install git-all Or, if you are on a debian based distribution, like Ubuntu: sudo apt-get install git-all
    • Windows
    • Just click here and download the latest version:
  2. Almost done. Now, copy this code, to download our repo. It's probably going to be in your Desktop. ;)
      cd Desktop
      git clone https://github.com/mrcolo/techLab.git
  3. All done. Don't worry if you didn't understand any of the commands above. We will take time to understand why Git is so important.

Let's start, shall we?


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"

I got the variables. Now what?


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.


Conditions


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!


Objects


Now let's go into something a little more specific. What's an object?

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!


Cool Stuff - A good way to end our lesson.


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?


Hey. What's the time?

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.


All done. Did it hurt?


This is what we learnt, so far, today.


Take Away Project 🌮🌮


Create a Celsius to Fahreneit converter. Display the result on an alarm that tells the current time too.