Strings - Javascript Language Basics

Javascript examples for Language Basics:Introduction

Introduction

You can define string values using either the double quote or single quote characters.

The quote characters you use must match. You can't start a string with a single quote and finish with a double quote.

Demo Code

ResultView the demo in separate window

<!DOCTYPE HTML>
<html>
    <head>
        <title>Example</title>
    </head>
    <body>
        <script type="text/javascript">
            var firstString = "This is a string";
            var secondString = 'And so is this';
        </script>
    </body>
</html>//from ww  w .  ja v  a2s .  com

Related Tutorials