A variable in JavaScript is the name of a storage location for data. For naming a variable, names can contain letters, numbers, underscores, and dollar signs. Names must begin with a letter, dollar sign, or underscore, and the names are case sensitive. To initialize the variable, use the equal sign to set the variable name equal to a piece of data, and to declare a variable, we need to use the var, let, or const keyword, then whatever we named the variable. The prompt() code tells the browser to display a text box with a message asking the user to input some data.
Link to image: https://www.programminghunk.com/2020/02/variables-in-javascript.html
Leave a Reply
You must be logged in to post a comment.