Photo by Malkarium on Unsplash


let cat = 'Mufasa';// Between the curly brace is the block scopefunction catName() { // Start of the block scope
console.log("catName:", cat);
}; // End of the block scope
function catRenamed() {
let cat = 'Scar'; // You can re-declare variables with the keyword let in different scopes
console.log("catRenamed:", cat);
console.log(cat); // What does this log out?

Photo by Free-Photos from Pixabay

Basic For Loop Syntax

for (index; condition; increment/decrement) {
// body of the loop
for (let i = 0; i < 5; i++) {…

Photo by Tyler Nix on Unsplash

Basic Syntax of Filter

const newArray = array.filter(item => {
return condition;

Using filter()

const prices = [10, 20, 30, 40, 50, 60, 70];const newPrices = prices.filter((price) => {
return price > 40;
console.log(prices) // [10, 20…

Photo by Brooke Lark on Unsplash

How should you style your code?

The Zen of Python, by Tim PetersBeautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that…

Photo by Joshua Hoehne on Unsplash

What is a Dictionary?

Image by congerdesign from Pixabay

Slicing a List

names = ["michael", "dwight", "jim", "kevin", "andy"]
>>> ['michael', 'dwight']

Image by Arek Socha from Pixabay

What is an If Statement?

name = "jill"if name == "jill":
print("Hey Jill")
elif name == "john":
print("Hello John")
print("Wait a minute, who are you?")
>>> Hey Jill
for number in range(1, 101):
if number == 7:
print(str(number) + " is my favorite number!")
elif number == 50:
print(str(number) + " is half of 100!") …

Image by Jose Antonio Alba from Pixabay


names = ("frank", "john")
>>> frank>>> john
names = ("frank", "john")
names[0] = "will">>> frank>>> johnTraceback (most recent call last):

Photo by Andrew Buchanan on Unsplash

Using the range() Function

for i in range(0, 3):
>>> 0>>> 1>>> 2

Photo by Tine Ivanič on Unsplash

Looping through a List

friends = ["kyle", "paul", "chris"]
>>> kyle>>> paul>>> chris

Aldrin Caalim

Learning is neat.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store