0

How to check if given object in a String in JavaScript

JavaScript
var aString = "my string";
var anInt = 5;
var anObj = {};

console.log(typeof aString === "string"); // true
console.log(typeof anInt === "string"); // false
console.log(typeof anObj === "string"); // false
RUN
add comment
Suggest a different solution or add another example