Programming with JavaScript
JavaScript make your web page more interactive by :
- you can access the content .
- you can modify the content
- program rules or instructions the browser can follow.
- react to events triggered by the user or browser .
Html and css quieq refresher :
Html element added to the content of page to describe the strcture . an element consist the opening , closing tags and the contant .
css uses rules to indicate how the contents of one or more elements should be displayed in the browser .each rule contain selector and declaration
tips to write the code
- defining a goal and designing the script .
- sketching out the tasks in a flowchart
expression
there are two type :
- expression that assign value to variable , which is doing using asignment operator (=).
- expression that use two or more values to return a single value .
operators type
- assignment operator (=)
- arithmetic operator
- string operator (+)
- comparsion operator
- logical operator
declaring function
to creating function you need to give it name and some statment in curly braces to achive.
calling function
to run the code in curly braces , you use the function name followed by parentheses
when you declar function you give parameters . inside the function the parameters will be as variable . when you need to call this function you must spicified the values inside parentheses. this value called argument and it can be provide as value or variable.
you can get a single value out of function by return the result of the function