JavaScript Programming
Share This Class:
Overview
JavaScript is one of the most popular programming languages used today. JavaScript is an object-oriented scripting language that runs in web browsers. It was originally developed by Brendan Eich at Netscape Communications Corporation. In this course, we’ll teach you everything about it.
Introduction to JS
Javascript is a client side script language that allows developers to write code that will run inside web pages. This means that javascript is not a server side language like PHP or ASP.NET. Instead, it is a client side language that runs inside the browser.
Variables
A variable is a name given to a piece of data. It’s similar to an index number in a book where each letter represents a different word. You can use variables to store values such as numbers, strings, dates, or even other variables.
A function is a set of instructions that perform a task. It’s like a recipe for cooking. If you follow the steps correctly, you should end up with something delicious.
An object is a collection of properties (variables) that belong together. An object is also known as a class because classes are objects that contain functions.
An array is a list of items. It’s like a shopping cart at the grocery store. You put things into the cart until you reach the checkout counter. Then you pay for what you’ve bought.
Arrays
Arrays are lists of items. They’re often used to represent collections of data. For example, you might have an array of names of people who live in a certain city.
Objects are more complicated than arrays. They’re like real-world examples of classes. Classes are groups of related properties that share common characteristics. For example, you could make a class called Person that has two properties: firstName and lastName.
Functions
A function is a block of code that performs some task. It’s similar to a procedure in other programming languages. You use functions to perform tasks such as adding numbers together, finding the average of a group of numbers, or sorting a list of words alphabetically.
Functions are also known as procedures because they resemble how a computer program works. A computer program is made up of instructions that tell the computer what to do. These instructions are called statements.
Objects
An object is a collection of data and properties. Properties are variables that store values. They’re often referred to as attributes.
Objects are very powerful because they allow us to organize our programs into groups. We can put related objects together so that they work together. This makes our programs easier to understand and maintain.
A good example of an object is a car. Cars have wheels, seats, doors, windows, headlights, and more. Each part of a car has different properties. Wheels have color, size, and material. Seats have color, shape, and padding. Doors have color, type, and handle. Windows have shade, size, and frame. Headlights have color, size, shape, and beam pattern.
Functions are similar to objects. They’re blocks of code that perform certain actions. They’re often used to make things happen when something happens.