W3Schools
w3schools.com › js › js_string_methods.asp
JavaScript String Methods
JS Examples JS HTML DOM JS HTML ... ... Javascript strings are primitive and immutable: All string methods produce a new string without altering the original string....
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String
String - JavaScript | MDN
Used to replace all occurrences of searchFor using replaceWith. searchFor may be a string or Regular Expression, and replaceWith may be a string or function. ... Search for a match between a regular expression regexp and the calling string. ... Extracts a section of a string and returns a new string. ... Returns an array of strings populated by splitting the calling string at occurrences of the substring sep. ... Determines whether the calling string begins with the characters of string searchString. ... Returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards.
Videos
- YouTube
08:03
Useful JavaScript STRING METHODS 🧵 - YouTube
04:21
Useful string methods in JavaScript 〰️【4 minutes】 - YouTube
01:30:25
All 34 String Methods In JavaScript In ONE VIDEO - YouTube
16:06
String Functions in JavaScript | Web Development Tutorials #50 ...
04:38
JS: String Methods - YouTube
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-string-methods
JavaScript String Methods - GeeksforGeeks
JS Tutorial · Web Tutorial · ... variety of built-in methods to work with strings — allowing you to extract, modify, search, and format text with ease....
Published August 14, 2025
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › Useful_string_methods
Useful string methods - Learn web development | MDN
Now that we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, ...
W3Schools
w3schools.com › jsref › jsref_obj_string.asp
JavaScript String Reference
Function apply() Function bind() Function call() Function length Function name Function toString() Function valueOf() JS Error · new Error() cause isError() name message JS Global · decodeURI() decodeURIComponent() encodeURI() encodeURIComponent() escape() eval() Infinity isFinite() isNaN() NaN Number() parseFloat() parseInt() String() undefined unescape() JS Iterators
Programiz
programiz.com › javascript › library › string
JavaScript String Methods | Programiz
JavaScript automatically converts primitive strings to String objects so that it's possible to use String methods and access properties even for primitive strings. In this reference page, you will find all String methods and properties available in JavaScript.
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › Strings
Handling text — strings in JavaScript - Learn web development | MDN
Conversely, the String() function converts its argument to a string. Try this: ... These constructs can be really useful in some situations. For example, if a user enters a number into a form's text field, it's a string. However, if you want to add this number to something, you'll need it to be a number, so you could pass it through Number() to handle this.
Programiz
programiz.com › javascript › string
JavaScript String (with Examples)
Write a function to concatenate two strings. Given two input strings (str1 and str2), return the concatenated string. For example, if str1 = "Hello, " and str2 = "World!", the expected output is "Hello, World!". Check Code · Previous Tutorial: Multidimensional Array · Next Tutorial: JS for...in ·
Top answer 1 of 10
207
A better way to create a function from a string is by using Function:
var fn = Function("alert('hello there')");
fn();
This has as advantage / disadvantage that variables in the current scope (if not global) do not apply to the newly constructed function.
Passing arguments is possible too:
var addition = Function("a", "b", "return a + b;");
alert(addition(5, 3)); // shows '8'
2 of 10
123
I added a jsperf test for 4 different ways to create a function from string :
Using RegExp with Function class
var func = "function (a, b) { return a + b; }".parseFunction();Using Function class with "return"
var func = new Function("return " + "function (a, b) { return a + b; }")();Using official Function constructor
var func = new Function("a", "b", "return a + b;");Using Eval
eval("var func = function (a, b) { return a + b; };");
http://jsben.ch/D2xTG
2 result samples:

javascript.com
javascript.com › learn › strings
JavaScript Strings: The Basic Methods and Functions | JavaScript.com
A string’s toLowerCase method in JavaScript returns a copy of the string with its letters converted to lowercase. Numbers, symbols, and other characters are not affected. A string’s toUpperCase method returns a copy of the string with its letters converted to capitals. Numbers, symbols, and other characters are not affected. A string’s trim method returns a copy of the string with beginning and ending whitespace characters removed.
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-strings
JavaScript Strings - GeeksforGeeks
You can combine two or more strings using + Operator. ... We can use escape characters in string to add single quotes, dual quotes, and backslash.
Published September 25, 2025
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › String
String() constructor - JavaScript | MDN
String function and String constructor produce different results: js · const a = new String("Hello world"); // a === "Hello world" is false const b = String("Hello world"); // b === "Hello world" is true a instanceof String; // is true b instanceof String; // is false typeof a; // "object" typeof b; // "string" Here, the function produces a string (the primitive type) as promised.
Javatpoint
javatpoint.com › javascript-string
JS String
JavaScript string object with example, by string literal, by string object (using new keyword), javascript string methods, charAt(index) method, concat(str) method, indexOf(str) method, lastIndexOf(str) method, lowerCase() method, upperCase() method, slice(beginIndex, endIndex) method, trim() ...
DEV Community
dev.to › devsmitra › javascript-string-methods-a-cheat-sheet-for-developer-4kbk
Javascript String Methods: A Cheat Sheet for Developer - DEV Community
October 30, 2023 - Let's understand javascript String functions and how to use them. ... const str = "Hello"; const str2 = " World"; str.concat(str2); // "Hello World" console.log(`${str}${str2}`); // "Hello World" console.log(str + str2); // "Hello World" const str = "Hello World"; str.endsWith("World"); // true · const str = "Hello World"; str.includes("World"); // true