Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Slice Out a Portion of a String</title> </head> <body> <script> var str = "The quick brown fox jumps over the lazy dog."; var subStr = str.slice(4, 15); document.write(subStr); // Prints: quick brown </script> </body> </html>