read 06

Java Script Introdution

JavaScript allows you to make web pages more interactive byaccessing and modifying the content and markup used ina web page while it is being viewed in the browser

A script is a series of instructions that a computer can follow to achieve a goal. Often scripts will need to perform different tasks in different situations. You can use flowcharts to work out how the tasks fit together. **Each time the script runs, it might only use a subset of all the instructions. **

Being able to change the content of an HTML page while it is loaded in the browser is very powerful.

EXPRESSIONS

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

OPERATORS

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

ARITHMETIC OPERATORS

JavaScript contains mathematical operators, which you can use with numbers. You may remember some from math class. ex2

STRING OPERATOR

There is just one string operator: the+ symbol. It is used to join the strings on either side of it. ex3

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).

Learn more about JS