Search code examples
javascriptgreasemonkey

Why isn't this function working on greasemonkey


Why isn't this function working in greasemonkey.

function arre(){
    var index;
    var fruits = ["Banana", "Orange", "Apple", "Mango"];
    for (index = 0; index < fruits.length; index++) {
        window.alert(fruits[index]);
    }
}

Solution

  • You just declared the function but did not call it. Just add to the end:

    arre();