View on GitHub

reading-notes

https://samahabujwaied.github.io/reading-notes/

I took befor about HTML & CSS , So to be clear I want to quickly explain about them:

Desighning a script steps:

Each individual task may be broken down into a sequence of steps . when you are ready to code the script , these steps can then be translated into individual lines of code.

Javascript has expression :

  1. Expression that just assign a value to a variable .

    ex: var color=’beige’;

  2. expressions that use two or more values to return a single value. ex: var area 3*2;

How you declaring a function in javascript?

A JavaScript function is defined with the function keyword, followed by a name, followed by parentheses (). Function names can contain letters, digits, underscores, and dollar signs (same rules as variables). The parentheses may include parameter names separated by commas: (parameter1, parameter2….)

## Example : #### First: You declare a function using the function keyword. #### Second: You give the function a name (sometimes called an identifier) followed by parantheses. #### Third: the statments that perform the task sit in a code block.(They are inside curly braces)

NOTE (If different parts of a script need to perform the same task , you do not need to repeat the same statments multiple times - you use a functionto do it(and reuse the same code)).

## Calling a function if you declared the function you can execute all of statments between its curly braces with just one line of code. _To run the code in the function you use the function name followed by parentheses.

Getting single value out of a function

Getting multiple values out of a function