From b1ba9264fb9ce189976e9fa54af009a9b47c0480 Mon Sep 17 00:00:00 2001 From: "Michael[tm] Smith" Date: Tue, 9 Mar 2021 17:28:52 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20=E2=80=9CHandling=20text=20=E2=80=94=20st?= =?UTF-8?q?rings=20in=20JavaScript=E2=80=9D=20typo=20(#2961)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/mdn/content/issues/2959 --- files/en-us/learn/javascript/first_steps/strings/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/javascript/first_steps/strings/index.html b/files/en-us/learn/javascript/first_steps/strings/index.html index 1bf0a0373588f18..6d2d1565c16cd84 100644 --- a/files/en-us/learn/javascript/first_steps/strings/index.html +++ b/files/en-us/learn/javascript/first_steps/strings/index.html @@ -153,7 +153,7 @@

Numbers vs. strings

  • Conversely, every number has a method called toString() that converts it to the equivalent string. Try this:
    let myNum2 = 123;
     let myString2 = myNum2.toString();
    -typeof myString;
    +typeof myString2;
  • 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. We did exactly this in our Number Guessing Game, in line 54.