1- Create a variable called colors
, assign the value Purple
to it.
var colors = "Purple";
var colors=āpurpleā;
var colors=āpurpleā;
var colors = āpurpleā;
Here's an example of creating a variable called `colors` and assigning the value "Purple" to it:
```javascript
var colors = "Purple";
In this example, the colors
variable is declared using the var
keyword and assigned the string value āPurpleā. Now, we can use the colors
variable to access or manipulate the value āPurpleā throughout JavaScript code.
var colors = āPurpleā;
var colors = āpurpleā;
var colors = āpurpleā;
var color = āpurpleā;
var color = āpurpleā;
var colors = āpurpleā
2- Create a variable called o
, assign the value 500
to it.
var colour =" Purple "
Here's an example of creating a variable called `o` and assigning the value 500 to it:
```javascript
var o = 500;
In this example, the o
variable is declared using the var
keyword and assigned the numeric value 500. Now, we can use the o
variable to perform arithmetic operations, comparisons, or any other manipulations involving the value 500 within JavaScript code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<section id="demo1">
krishna
</section>
<script>
var color ='purple';
</script>
</body>
</html>
2- Create a variable called o
, assign the value 500
to it.
var o = 500;
varibles :-
var o = 500;
var colors = āpurpleā;