JavaScript Variables & values

Variable names

Allowed 

let userName                                          Best practice: camelCase

let ageGroup5                                   Only letters and digits 

let $kindOfSpecial                            starting $ is allowed

let_internalValue                             Starting with _is allowed

Not Allowed / not recommended

let user_Name             Allowed but bad practice

let 21Players              Starting digits not be allowed

let user-b                    No special characters

let let                        keyboards not allow


 Understanding Values 

let userName = 'max' A data container/data storage

userName ='manu'   Where the value change

Const totalUsers=15;   A data container/data storage

TotaUsers=20     No change 

"Hi, I'm max!" text (string)

32  Number 

 There are more available values: Booleans, Objects Arrays 

A Variable is a box you can store numbers or text  

<script> </script>

Alert(); pop up


let nameVariable = value;

<script src="app.js"> </script>  CALL JAVASCRIPT IN HTML






Comments

Popular posts from this blog

Events Js