JAVASCRIPT
What is JavaScript
 JavaScript is a text-based programing language.
 It is used both on client-side and server-side. That allows you to make a web pages
interactive.
 HTML & CSS are languages that gives structure and style to web pages, JavaScript gives
web pages interactive elements that engage a user.
What can JavaScript can do?
o JavaScript can change HTML content.
o JavaScript can change HTML attributes.
o JavaScript can change HTML styles (CSS)
o JavaScript can hide html elements.
o JavaScript can show html elements.
Advantages of JavaScript?
 Speed
 Simplicity
 Popularity
 Interoperability
 Server load
 Rich interface
 Extended functionality
 Versatility
Disadvantages of java script?
 Cannot Debug
 Unexpected stop of rendering
 Client-side Security
 Inheritance
 Browser Support
Variables
Variable using 3 keywords that are var, let, and const.
1.Var: Global scoped or function scoped.
Redeclare & reassign.
<script>
var x= 10010;
// var x= 1001;
console.log(x);
</script>
2.Let: let variable is only block scoped. It can’t be accessible outside the
particular block ({block}).
Reassign
<script>
let x= 10;
// console.log(x);
x= 20;
console.log(x);
</script>
3.Const: The scope of a const variable is block scope.
Redeclare & reassign.
<script>
const x= 10;
console.log(x);
const y=11;
console.log(y)
</script>
DATA TYPES:

JAVASCRIPT.docx

  • 1.
    JAVASCRIPT What is JavaScript JavaScript is a text-based programing language.  It is used both on client-side and server-side. That allows you to make a web pages interactive.  HTML & CSS are languages that gives structure and style to web pages, JavaScript gives web pages interactive elements that engage a user. What can JavaScript can do? o JavaScript can change HTML content. o JavaScript can change HTML attributes. o JavaScript can change HTML styles (CSS) o JavaScript can hide html elements. o JavaScript can show html elements. Advantages of JavaScript?  Speed  Simplicity  Popularity  Interoperability  Server load  Rich interface  Extended functionality  Versatility Disadvantages of java script?  Cannot Debug  Unexpected stop of rendering  Client-side Security  Inheritance  Browser Support Variables Variable using 3 keywords that are var, let, and const. 1.Var: Global scoped or function scoped. Redeclare & reassign. <script> var x= 10010; // var x= 1001; console.log(x); </script>
  • 2.
    2.Let: let variableis only block scoped. It can’t be accessible outside the particular block ({block}). Reassign <script> let x= 10; // console.log(x); x= 20; console.log(x); </script> 3.Const: The scope of a const variable is block scope. Redeclare & reassign. <script> const x= 10; console.log(x); const y=11; console.log(y) </script> DATA TYPES: