Skip to content
JS FAQ - JavaScript Guides Online

Get answers to your JavaScript questions. Explore detailed how-to guides, code examples, and best practices for beginners and developers.

  • Home
  • Home
Books
Home » quotes
How to create a string in JavaScript
Posted inStandard Objects: String

How to create a string in JavaScript

Posted inStandard Objects: StringTags: declaration, js string, quotes, string
JavaScript's new String() constructor creates an object, not a primitive string. This causes strict equality (===) to fail, as typeof is 'object'. This difference between a string primitive and a string wrapper object leads to comparison bugs. Always avoid the new String() constructor.
Read More
Copyright 2026 — JS FAQ - JavaScript Guides Online. All rights reserved.
Scroll to Top