Template Literals

 HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Template Literals</title>
</head>
<body>
    <h1>Template Literals</h1>
    <script src="TemplateLiterals.js"></script>
</body>
</html>

CSS

let pencilPrice=10;
let eraserPrice=5;

let output=`Total price: ${pencilPrice+eraserPrice} Rupees`;
console.log(output);

Comments

Popular posts from this blog

Callback Hell

TODO list with DOM

Refactoring callback hell code