JavaScript - Create an Empty String

Veröffentlicht am: 25 Juni 2024
auf dem Kanal: ProgramGuru
132
2

To create an empty string in javascript, you can use empty quotes, or new String.

In the first example, we create a variable 'name' assigned with an empty string using empty quotes.

To verify if it is an empty string, we print its length to output, which is zero.

In the second example, we create an empty string using new String(). And print its length to output.

Using empty quotes, or new String() are two of the many ways in which you can create an empty string in JavaScript.

Thank you for watching. If you like the explanation, like the video, and subscribe to our channel.

Reference
=========
https://programguru.org/javascript/ho...


Auf dieser Seite können Sie das Online-Video JavaScript - Create an Empty String mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer ProgramGuru 25 Juni 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 132 Mal angesehen und es wurde von 2 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!