About 13,900,000 results
Open links in new tab
  1. What does ${} (dollar sign and curly braces) mean in a string in ...

    Mar 7, 2016 · What does $ {} (dollar sign and curly braces) mean in a string in JavaScript? Asked 9 years, 9 months ago Modified 2 years ago Viewed 426k times

  2. String interpolation in JavaScript? - Stack Overflow

    Jul 20, 2014 · 217 Douglas Crockford's Remedial JavaScript includes a String.prototype.supplant function. It is short, familiar, and easy to use:

  3. 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 ""?

  4. How can I use backslashes (\) in a string? - Stack Overflow

    In JavaScript, the backslash has special meaning both in string literals and in regular expressions. If you want an actual backslash in the string or regex, you have to write two: \\.

  5. Check if a variable is a string in JavaScript

    In JavaScript you can have variable type of string or type of object which is class of String (same thing - both are strings - but defined differently) thats why is double checked.

  6. How do I chop/slice/trim off last character in string using …

    Be aware that String.prototype.{ split, slice, substr, substring } operate on UTF-16 encoded strings None of the previous answers are Unicode-aware. Strings are encoded as UTF-16 in most …

  7. javascript - How to get first character of string? - Stack Overflow

    The whole "array" thing is cute and shows off casting strings to arrays and such but the question is, literally, "how do I get a one-character substring from the start of the string"; the obvious …

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

    In all other cases, you're safe to use ==. Not only is it safe, but in many cases it simplifies your code in a way that improves readability. I still recommend Crockford's talk for developers who …

  9. Trim string in JavaScript - Stack Overflow

    Jan 31, 2009 · 166 Although there are a bunch of correct answers above, it should be noted that the String object in JavaScript has a native .trim() method as of . Thus ideally any attempt to …

  10. How can I build/concatenate strings in JavaScript?

    I'm working on a JavaScript project, and as it's getting bigger, keeping strings in good shape is getting a lot harder. I'm wondering what's the easiest and most conventional way to construct …