About 669,000 results
Open links in new tab
  1. Check if a variable is a string in JavaScript - Stack Overflow

    How can I determine whether a variable is a string or something else in JavaScript?

  2. How do I check for an empty/undefined/null string in JavaScript?

    Is there a string.Empty in JavaScript, or is it just a case of checking for ""?

  3. Is there a standard function to check for null, undefined, or blank ...

    Apr 1, 2011 · Is there a universal JavaScript function that checks that a variable has a value and ensures that it's not undefined or null? I've got this code, but I'm not sure if it covers all cases: …

  4. What is the correct way to check for string equality in JavaScript ...

    Aug 27, 2010 · So the best way to check for equality is using the === operator because it checks value as well as type of both operands. If you want to check for equality between two objects …

  5. How can I check if a var is a string in JavaScript?

    possible duplicate of Check whether variable is number or string in javascript – Jonathan Hall Aug 21, 2015 at 20:12 This is also a duplicate of Check if a variable is a string in JavaScript – Alf …

  6. How do I check if a variable is an array in JavaScript?

    variable.constructor === Array This is the fastest method on Chrome, and most likely all other browsers. All arrays are objects, so checking the constructor property is a fast process for …

  7. JavaScript check if variable exists (is defined/initialized)

    Feb 6, 2009 · 2475 Which method of checking if a variable has been initialized is better/correct? (Assuming the variable could hold anything (string, int, object, function, etc.))

  8. javascript - how to detect if variable is a string - Stack Overflow

    Feb 3, 2011 · Yes, it will get coerced into a string via Object 's toString method, but the fact remains that new String('some string') is not a string, in and of itself. typeof someString === …

  9. How can I check for an undefined or null variable in JavaScript?

    If the purpose of the if statement is to check for null or undefined values before assigning a value to a variable, you can make use of the Nullish Coalescing Operator.

  10. How can I check for "undefined" in JavaScript? - Stack Overflow

    Detecting an undefined object property (49 answers) How to check a not-defined variable in JavaScript (15 answers) How to handle 'undefined' in JavaScript [duplicate] (3 answers) How …