100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
programming language $9.49   Add to cart

Class notes

programming language

 1 view  0 purchase
  • Course
  • Institution

I delve into the fundamentals of JavaScript, focusing on its Document Object Model (DOM) and basic programming concepts. Join me on a journey through JavaScript's core principles, and discover how to leverage DOM for dynamic web development. Whether you're a beginner or looking to reinforce your pr...

[Show more]

Preview 1 out of 3  pages

  • February 19, 2024
  • 3
  • 2022/2023
  • Class notes
  • Java computer programming
  • All classes
avatar-seller
Javascript Crash Course
Hi guys! After receiving so many requests, here is a crash course on JavaScript.
JavaScript is the most popular programming language in the world and it is easy to
learn. It is used to create interactive and dynamic web pages.

Variables
In JavaScript, variables are used to store data. They can be created using the var,
let, or const keywords.

var: used to declare a variable with function scope or global scope.
let: used to declare a block-scoped variable.
const: used to declare a constant variable.
Data Types
JavaScript has several data types:

Primitive Data Types: number, string, boolean, null, undefined.
Non-primitive Data Types: object.
Operators
JavaScript has several operators:

Arithmetic Operators: +, -, *, /, %.
Assignment Operators: =, +=, -=, *=, /=, %=.
Increment and Decrement Operators: ++, --.
Comparison Operators: ==, ===, !=, !==, <, >, <=, >=.
Logical Operators: &&, ||, !.
Functions
A JavaScript function is a block of code designed to perform a specific task. They
can be created using the function keyword.

function functionName() { // code to be executed}
Function Parameters
Function parameters are used to pass values to a function when it is called. They
are defined when declaring the function.

function functionName(parameter1, parameter2) { // code to be executed}
Statements
JavaScript statements are used to control the flow of execution in a program. They
include if-else statements and loops.

If-Else Statements
If-else statements are used to execute a block of code based on a specific
condition.

if (condition) { // code to be executed if condition is true} else { // code to
be executed if condition is false}
For Loop
A for loop is used to repeatedly execute a block of code for a specific number of
times.

for (initialization; condition; increment/decrement) { // code to be executed}
Demo okay, so 1, 3, 9, 10. Okay, okay. I should bring each and every apple from
this side to the other side. Task, okay, okay, start. Okay, okay, first the count =
1, 2, 3, 4. Okay, less than or equal to 5. Correct, true. Next, next, start + 1.
Certainly false. Okay, okay, counter already 1, second one, third one. Okay, for
count, okay, correct 1, 2, 3, 4, 5. Condition, count = count + step 1. Step 1,
count = 1, count <= 5, 1 <= true, count = count + 1. Step 2, count = 2, count <= 5,
2 <= 5, count or 1, 2, 3. Okay, okay, so again, okay, okay, next. So okay, print
all the numbers from 1 to 10 using a for loop. 1, 2, 3, 4. Count, count, 2, 3, 4.
Okay, okay, so instead count = count. Okay, okay, so next number, reverse number.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller sarveshs. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $9.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75323 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$9.49
  • (0)
  Add to cart