Trying to console.log my array name that is being passed through the function (in this case, it'll be basket)

function empty(array){
  array.splice(0, array.length);
  console.log('Emptying array...');
  if(array.length === 0){
    console.log(array, 'is empty!'); 

  //deletes all items from index 0 to end of basket


When I'm trying to console.log the confirmation of emptying the array, how do I pass in the actual name of the array? In this case, I'm trying to pass in through basket.

Update: I'm pretty new to coding so I'm just trying to navigate this in the best way I can. Making sense of things that don't make sense at the moment haha

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum