Code submission for: Jordan Hudgens

Submission Status: Failed

Submitted for: How to Build a Switch Statement in JavaScript to Check for Data Types

Submitted at: June 18, 2019

function switchStatement(val) {
    
  switch (typeof val) {
  case "string":
    console.log("It's a string");
    break;
  case "number":
    console.log("It's a number");
    break;
  case "boolean":
    console.log("It's a boolean");
    break;
  default:
    console.log('No matches');
}
    
}

switchStatement(3);
Unsupported Browser

devCamp does not support ancient browsers.
Install a modern version for best experience.