Skip to content

Latest commit

 

History

History
42 lines (21 loc) · 1.8 KB

read06.md

File metadata and controls

42 lines (21 loc) · 1.8 KB

Introduction to JavaScript

JavaScript

JavaScript allow you to to makeweb pages more interactive by accessin and modifying the content and markup use in web page while it's being viewed in the browser

A script is a series of instructions that the computer can follow in order to achieve a goal.

Computers approach tasks in a different way than humans, so your instructions must let the computer solve the task prggrammatically. To approach writing a script, break down your goal into a series of tasks and then work out each step needed to complete that task (a flowchart can help)

How JavaScript make the pages more interactive

  • ACCESS CONTENT
  • MODIFY CONTENT
  • PROGRAM RULES
  • REACT TO EVENTS

Expressions & Operators

An expression evaluates into (results in) a single value. Broadly speaking there are two types of expressions.

  • EXPRESSIONS THAT JUST ASSIGN A VALUE TO A VARIABLE

  • EXPRESSIONS THAT USE TWO OR MORE VALUES TO RETURN A SINGLE VALUE

Expressions rely on things called operators; they allow programmers to create a single value from one or more values.

Types of Operators

Operators

Functions

Functions let you group a series of statements together to perform a specific task. If different parts of a script repeat the same task, you can reuse the function (rather than repeating the same set of statements).

Function