Reading-Notes

View the Project on GitHub MohammadAl-khatib/Reading-Notes

JavaScript

  image  

Definition:

JavaScript is a programming language well known for scripting web pages, although it might be used in other environments such as Node.js, Apache CouchDB and Adobe Acrobat. The main use of programming languages in web pages is adding functionality to the page i.e. make it more dynamic and interactive.

Converting a web page from HTML static page to a dynamic page means that clicking, scrolling, and clicking a button will have certain functions to do. your web page can ask for data and reply with info, will have pop up windows, will do arithmatic and logic operations, and a lot more.

Input and Output

As we mentioned earlier, JavaScript prepared web page can interact with user, now we will mention some of syntaxes used for this purpose (simplified as possible):

Syntax Semantics
document.write(sth) prints sth on web page
prompt asks for data entry
alert(message) shows a messaage to users

Statements and operations

JavaScript can process data using a set of statements and operations. Statements like:

operations like:

     

JavaScript Variables

Variables are containers to store data in order to make processes on, or to be recalled later, data can be a number, a string (text), a boolean (having a value of yes or no),….etc. Each variable has a name, a value, and data type

To assign a value for a variable use = sign, for example: var name = “Ahmad” stores the text Ahmad in a variable called name.

                       

References

For details, please visit:

  1. MDN Web Docs
  2. Code-Maven
  3. w3schools