const displayTable = (number) => {
    const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; 
    const countingArray = numbers.map((item) => {
        console.log(item*number);
    });
}
displayTable(2);

BY Best Interview Question ON 24 Aug 2022