Strings 2: Speech Marks

Strings 2: Speech Marks

<script type="text/javascript">
 string_one   = 'And he said "hello!" to everyone'; // valid
 string_two   = "And he said 'hello!' to everyone"; // valid
 string_three = "And he said "hello!" to everyone"; // invalid 
 string_four  = 'And he said 'hello!' to everyone'; // invalid
 string_five  = 'And he said \'hello!\' to everyone'; // valid
 string_six   = "And he said \"hello!\" to everyone"; // valid
</script>
Comments are closed.