Answers for "check if var is string in js"

15

javascript is variable a string

if (typeof myVar === 'string'){
    //I am indeed a string
}
Posted by: Guest on July-23-2019
1

check if value string js

var value = "test string"
console.log(typeof value === "string")
Posted by: Guest on October-25-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language