JavaScript Code for Practice

·

1 min read

Here are a few more examples of javaScript code for practice.

.

.

.

.

.

.

.


What will be the value of fruit after calling the function changeFruit?

    let fruit = ['apple', 'mango', 'banana'];
        function changeFruit( fruit ) {
                fruit[2] = "orange";
                return fruit;
        }

        console.log(changeFruit(fruit));

//  Values are  ['apple', 'mango', 'orange']

..