HEADER ADS 728X90

How to use Switch Case Expression In javascript | Javascript Tutorial | By Codeprime

css,html,php,javascript,tutorial,code prime,javascript switch case multiple arguments,switch case js,how to call a function in switch case in javascript,javascript switch string,js switch return,switch case java,javascript switch case range,switch,case,expresion,online tutorial,easy tutorial,web dev,web dev simpilified,javascript tutorial for beginners,javascript full course,javascript tutorial,how to use switch case in javascript,online education,software,js, codeprime, coding tutorial, how to learn coding easy way to learn coding

Hi dear welcome to "CodePrime" Blog . In this post YOU are going to learn Switch Case Expression Uses In javascript | How to use switch? | JS Tutorial | By Codeprime. First Creat A index.html file Copy This HTML CODE and pest it one your code editor. 2ndly creat switch.js file Then Copy The JS CODE and pest it then open the index.html file with your browser.

HTML CODE

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="/switch.js"></script>
    <title>javascript</title>
</head>
<body>
    <h2>Javascript Tutorial</h2>
    <h3>By Codeprime</h3>
   
</body>
</html>

JAVASCRIPT CODE

let games= 'football';

switch(games) {
    case "throwball":
    console.log("i dont like");
    break;
    case "basketball":
    console.log("i like basketball");
    break;
    case "cricket":
    console.log("i dont like criket");
    break;
    case "football":
    console.log("i like football");
    break;
    default:
    console.log("i like other games");
    break;

}

Youtube Tutorial

FLOW US ON SOCIAL MEDIA

Post a Comment

0 Comments

Join Telegram