Code to go logo
Created using Figma
Use Cases
Contribute
How to check if variable is a string in JavaScript
Strings
By Jad Joubran ·
Last updated Apr 28, 2018
const input = "potential string"; typeof input === "string";
true
Apr 28, 2018
1
Jad Joubran
See answer
1
Jad Joubran
typeof
on MDN
Learn JavaScript step by step