Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Extract Out a Portion of an Array</title> </head> <body> <script> let fruits = ["Apple", "Banana", "Mango", "Orange", "Papaya"]; let subarr = fruits.slice(1, 3); document.write(subarr); // Prints: Banana,Mango </script> </body> </html>