score in
backticks
(`)
let score = 50;
let content = ` The score of winning team is:
{ score
`
console.log(content);
Expected Output => The score of winning team is: 50
square of a.
let a = 5;
let b = 2;
var mySquare = a b
remainder of a and b in
variable remainder.
let a = 5;
let b = 2;
var remainder = a b
Output: The sum of two values is : 15
x = 12;
y = 3;
z = x + y
console.log("",)
2 in prompt box
x = prompt ("Enter a number between 1 to 10")
if (x === 2) {
console.log("Correct")
} else {
console.log("Wrong")
}
Output:
script.js file externally in
head
<p id='para'> I am the one you are supposed to fetch
</p>
Output :
document.
('para')
<p class='some'> I am the one you are supposed to fetch
</p>
Output :
document.
('.some')
<p id='para' class='some'> I am the one you are supposed to
fetch </p>
Output :
document.
('p')
myAge if the user enters 20 in prompt box
let myAge = prompt("Please enter your age");
console.log(typeof myAge);
Output :