I have a string array where I need to display from 2nd item onwards. But within each item I need to further display from 2nd item. Say
I have an array
function myFunction() {
var fruits = ["BBanana", "BOrange", "TLemon", "TApple", "YMango"];
var citrus = fruits.slice(1).join("<br/>"); //skip first item
document.getElementById("demo").innerHTML = citrus;
}
The expected output is
Orange
Lemon
Apple
Mango
Instead
BOrange
TLemon
TApple
YMango
How do i achieve using improved performance?