File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -408,3 +408,38 @@ Symbols are skipped by for…in
408408
409409- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
410410- https://javascript.info/symbol
411+
412+ ---
413+
414+ ### 14. Demonstrate the usage of String Escape Sequences
415+
416+ - Specifies that the following character should be interpreted as a literal character
417+
418+ ` ` ` js copy
419+ // 1. Newline and Tab
420+ const newlineTabExample = " Line 1\n Line 2\t Tabbed" ;
421+ console .log (newlineTabExample);
422+ // Output:
423+ // Line 1
424+ // Line 2 Tabbed
425+
426+ // 2. Escaping Double Quotes
427+ const escapeDoubleQuoteExample = " He said, \" Hello, World!\" " ;
428+ console .log (escapeDoubleQuoteExample);
429+ // Output: He said, "Hello, World!"
430+
431+ // 3. Escaping Single Quotes
432+ const escapeSingleQuoteExample = ' It\' s a wonderful day!' ;
433+ console .log (escapeSingleQuoteExample);
434+ // Output: It's a wonderful day!
435+
436+ // 4. Unicode Smiley Face
437+ const unicodeSmileyExample = " Smile: \u263A " ;
438+ console .log (unicodeSmileyExample);
439+ // Output: Smile: ☺
440+
441+ // 5. File Path with Double Backslashes
442+ const filePathExample = " Path: C:\\\\ Program Files\\\\ MyApp" ;
443+ console .log (filePathExample);
444+ // Output: Path: C:\\Program Files\\MyApp
445+ ` ` `
You can’t perform that action at this time.
0 commit comments