My journey into coding has been an on-again, off-again type of relationship but I started taking it seriously in March when the lockdown and WFH due to the Coronavirus pandemic kicked in fully.
I started off with what can arguably be considered the table stakes (for frontend development) - HTML and CSS - using Codecademy, FreeCodeCamp and YouTube.
Also, I put together a bunch of music for you to enjoy while you read.
The language now supports the:
Ability to create business applications on the web
Ability to create any kind of utility, security or data application
Ability to communicate with Browser Application Programming Interfaces (APIs)
Ability to communicate with third-party APIs
Ability to rapidly build sites and native applications using third-party frameworks and libraries
tag and then inserting it inside the
tag of the .html file.
<p> I am ready </p>
It is common to use the
🔴 Commenting Code
This is important to avoid any form of ambiguity in your code when another developer picks it up. Any kind of complexity, trickiness or indeed anything that could be confusing should be commented on in your code.
Single line comment can be added using a double
// single line comment
A multiple line comment can be added using a
before the comment and a
after the comment.
/* multiple line comment */
Any application that is being written depends on data (f
or eCommerce, we need data on the product e.g product name, price and all the data that belongs to an invoice or a purchase order. Same applies for an application that works within a car, games etc
🔴 Declaring Variables
is used. After the keyword
, we have the variable identifier that we want to use, then an equal sign, followed by the value of that variable.
let total = 149.99;
let product = 'hiking boots';
let discounted = true;
From the above code snippet, you will notice that the value assigned to the variable
is enclosed in quotation marks, the reason is because
is a string and computers don't recognize strings without quotation marks, this however doesn't apply to numbers as seen in
. While for
the absence of quotation marks is as a result of the assigned values being
Rules For Naming Variables
A variable name (also known as identifier) can begin with "
" , "
" and subsequent characters can be digits (
let _2total = 149.99;
let $to_tal = 149.99;
let total99 = 149.99;
let 5total = 149.99;
keyword is used to declare variables with dynamic values,
keyword is used to declare variables whose values are static (i.e the value of a constant can't be changed through reassignment, and it can't be redeclared).
An advantage of using
is that it helps guide other developers looking at your code in the future giving them a clue that something is not suppose to change.
const price = 149.99;
price = 50.99;
// expected output: TypeError: invalid assignment to const `number'
const price = 149.99;
// expected output: 42
Feel free to drop a comment for me if you spot anything off and will like to point me in the right direction. I'll appreciate that.
Thanks to Bisi and Seun for helping out with the edits.