Get the App
SLTechnology News&Howtos  ›  Development  › 

Case Analysis of JavaScript string and number

Shulou Source: shulou.com Published: 2022-06-01 05:38:56 09月26日 Update

This article mainly talks about "JavaScript string and numerical example Analysis". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "JavaScript string and numerical example Analysis".

JavaScript string

A string is a variable that stores characters, such as "BillGates".

The string can be any text in quotation marks. You can use single or double quotation marks:

Example

Varcarname= "VolvoXC60"

Varcarname='VolvoXC60'

You can use quotation marks in a string, as long as they do not match the quotation marks that surround the string:

Example

Varanswer= "It'salright"

Varanswer= "Heiscalled'Johnny'"

Varanswer='Heiscalled "Johnny"'

You will learn more about strings in the advanced parts of this tutorial.

JavaScript digit

JavaScript has only one numeric type. Numbers can be decimal or not:

Example

Varx1=34.00;// uses decimal point to write

Varx2=34;// does not use decimal points to write

Very large or very small numbers can be written by scientific (exponential) counting:

Example

Vary=123e5;//12300000

Varz=123e-5;//0.00123

At this point, I believe you have a deeper understanding of "JavaScript string and digital example analysis". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Characters strings examples numbers quotation marks instance analysis analysis decimal point content more learning practical deeper minimal advanced interest variables only can be passed through Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Technology Docker MySQL macOS