Web Application Penetration Testing and Secure Coding #15 – JavaScript Basics #3 – Variables

Web Application Penetration Testing and Secure Coding #15 – JavaScript Basics #3 – Variables


Hey everyone I am Vikram Salunke and Welcome to the Web Application Penetration Testing and Secure Coding This is a video number 15 and part 3 in a JavaScript Basics In this video we will see variables JavaScript variables are known as the containers to store the data values let’s see the variables in an action this is our skeleton program this is our script to define JavaScript variables we use var keyword so, let’s define first variable var a=2; var b=43; var c=210; so this is how we define variables in a JavaScript using var keyword as we can see here a stores the value 2 b stores the value 43 and c stores the value 210 let’s print these variables values onto the webpage for that we will use id=display document.getElementById(“display”). innerHTML=a let’s give some break here b let’s give some break here c ; save it and as we can see the values of the variables has been printed on a screen let’s see another example var num=3; var name=”vikram”; var pi=3.14; as we can
see JavaScript can handle multiple data types such as integer, string, float etc. and by using the same getElementById let’s print those values onto the webpage so, those values has been printed on the webpage as we can see here strings are written inside single or double quotes and numbers are written without the quotes now, there are some rules to declare JavaScript variables first one is variable name must be unique second one is variables can contain letters, digit, underscore and dollar signs variables are case-sensitive that means this name is different that this Name and the last one is variables cannot use JavaScript keywords such as if, for, switch etc. that’s it for this video if you like this video then hit the like button and if you are new to the channel then click on subscribe button Thank you 🙂

One thought to “Web Application Penetration Testing and Secure Coding #15 – JavaScript Basics #3 – Variables”

Leave a Reply

Your email address will not be published. Required fields are marked *