---
id: 65e9713d484dd50f720e6fe6
title: Learn Data Types and Conditionals Lesson A
challengeType: 15
dashedName: learn-data-types-and-conditionals-lesson-a
---
# --description--

Depending on what kind of work you're doing, you might end up working more with pieces of text rather than numbers. A **string** is a piece of text… and is a fundamental building block of the language.

HTML provides structure and meaning to text, CSS allows us to precisely style it, and JavaScript offers many features for manipulating strings. These include creating custom welcome messages and prompts, showing the right text labels when needed, sorting terms into the desired order, and much more.

Strings are a fundamental data type in JavaScript. They are used to represent text and are wrapped in either single, double quotes or backticks:

```javascript
let greeting = "Hello World!";

let greeting2 = 'I am learning JavaScript!';

let greeting3 = `with The Odin Project!`;
```

Strings declared using single quotes and strings declared using double quotes are the same, and which you use is down to personal preference — although it is good practice to choose one style and use it consistently in your code.

# --assignment--

There are many ways to manipulate strings in JavaScript. Go through points 8 through 12 of our <a href="https://www.freecodecamp.org/news/javascript-string-handbook/" target="_blank">JavaScript String Handbook</a>

# --questions--

## --text--

Which statement accurately describes the versatility and use of strings in JavaScript in conjunction with HTML, CSS, and JavaScript itself?

## --answers--

Strings in JavaScript can only be manipulated using CSS for web page design.

---

JavaScript strings are exclusively used for mathematical computations and cannot interact with HTML or CSS.

---

Strings allow for text manipulation in JavaScript, including but not limited to creating custom messages, sorting terms, and dynamically updating HTML content with CSS styling.


## --video-solution--

3
