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...
Sur cette page du site, vous pouvez voir la vidéo en ligne JavaScript - Create an Empty String durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur ProgramGuru 25 juin 2024, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 132 fois et il a aimé 2 téléspectateurs. Bon visionnage!