GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add introduction about strings: creation · janeshdev/javascript@2d8cbe0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • SUMMARY.md
  • strings
    • README.md
    • create.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎SUMMARY.md‎

Copy file name to clipboardExpand all lines: SUMMARY.md
+2-1Lines changed: 2 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
* [Creation](numbers/create.md)
99
* [Basic Operators](numbers/operators.md)
1010
* [Advanced Operators](numbers/advanced.md)
11-
11+
* [Strings](strings/README.md)
12+
* [Creation](strings/create.md)
Collapse file

‎strings/README.md‎

Copy file name to clipboard
+7-1Lines changed: 7 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Strings
22

3-
JavaScript strings share many similarities with string implementations from other high-level languages, such as Python's. They represent text based messages and data.
3+
JavaScript strings share many similarities with string implementations from other high-level languages. They represent text based messages and data.
44

55
In this course we will cover the basics. How to create new strings and perform common operations on them.
6+
7+
Here is an example of a string:
8+
9+
```javascript
10+
"Hello World"
11+
```
Collapse file

‎strings/create.md‎

Copy file name to clipboard
+2-23Lines changed: 2 additions & 23 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Creation
22

3+
You define strings in JavaScript by enclosing the text in single quotes or double quotes:
4+
35
```js
46
// Single quotes can be used
57
var str = 'Our lovely string';
@@ -27,26 +29,3 @@ assert(str === 'abc');
2729
```
2830

2931
---
30-
31-
### Transforming objects to strings with .toString()
32-
33-
Most javascript objects such as `Number`s can be transformed into strings using the `.toString()` method.
34-
35-
---
36-
37-
Create a variable named `numstr` that is a string transformed from the `num` variable.
38-
39-
```js
40-
var num = 27;
41-
```
42-
43-
```js
44-
var num = 27;
45-
var numstr = 27.toString();
46-
```
47-
48-
```js
49-
assert(numstr === '27');
50-
```
51-
52-
---

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.