Skip to content

skywalkerSam/JS-101

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Everything that can be written in JavaScript will be written in JavaScript.)

P.S. You'll get it soon enough...

Data Types ( Primitive )

Everything that's not a primitive datatype, is an Object in ...JavaScript!

  1. string
  2. number
  3. bigint
  4. boolean
  5. undefined
  6. symbol
  7. null

Primitive

  • Arrays ( list ) - Multidimensional array

  • Objects ( map, dictionary, or hash-table ) - Key-Value pairs

Non-primitive

  • Stacks

  • Queues

  • Linked lists

  • Trees

  • Graphs

  • Roundup

  • !== - !=

  • === - ==

  • >=

  • <=

  • >

  • <

Variables

Variables are containers for storing data values

  • var
  • let ( ES6 )
  • const ( ES6 )

Variable naming conventions

  • camelCase: JavaScript

  • CONSTANTS: Immutable, Shouldn't be modified...!

  • snake_case: Python

  • PascalCase: C/C++

Conditionals

  • if
  • else if
  • else
  • switch-case
  • Ternary Operators ( ? : )

Logical Operators

  • &&: and
  • ||: or
  • !: not!

Functions

A function() must return something

  • const x = function name() {}
  • function name() {}
  • Arrow Functions ( ES6 ): () => {}

Loops

  • for
  • forEach ( ES6 )
  • do
  • while

Some Common Functions

  • alert()

  • prompt()

  • clear()

  • print(): Print the webpage, not like python...!

The adventures await...

Calculations with Numbers & Strings

3 + "6"

  • "36"

9 - "6"

  • 3

9 % 3

  • 0

"Java" + "Script"

  • "JavaScript"

" " + " "

  • ''

" " + 0

  • '0'

true + true

  • 2

true + false

  • 1

false + true

  • 1

true - false

  • 1

false - true

  • -1

6 - 9

  • -3

"Starboy" - "Sam"

  • NaN

9 >= 6

  • true

0 === 1

  • false

9 <= 6

  • false

0 !== 0

  • false

"A" > "B"

  • false

"B" < "C"

  • true

"a" > "A"

  • true

"b" < "A"

  • false

true === false

  • false

true != true

  • false

Make a String

"Hi There! It's sunny out" by using the + sign.

  • "Hi There! " + "It's "sunny" out"

Or, just use the '/" interchangeably...

JavaScript in a nutshell

Special Keywords

  • break
  • case
  • catch
  • class
  • const
  • continue
  • debugger
  • default
  • delete
  • do
  • else
  • export
  • extends
  • finally
  • for
  • function
  • if
  • import
  • in
  • instanceof
  • new
  • return
  • super
  • switch
  • this
  • throw
  • try
  • typeof
  • var
  • void
  • while
  • with
  • yield

At last, Please don't confuse JavaScript with Java.)

P.S Get it?

Introduction to Vanilla "JavaScript".)

NOTE: Try to just NEVER write Vanilla, or you'll end up creating your own little JS Framework, and the last thing this world needs is another JavaScript Framework.)

JavaScript starter pack.)

P.S. You'll get this soon enough too.)

Until next time.)

About

JavaScript 101

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages