//create a variable to hold the input field
const input = document.querySelector('.input');
//create a variable to hold the output field
const output = document.querySelector('.output');
//create a variable to hold the button
const button = document.querySelector('.button');
//create a variable to hold the array of data
const data = [
'apple',
'banana',
'orange',
'grape',
'pear',
'strawberry',
'kiwi',
'mango',
'watermelon',
'pineapple',
'avocado',
'peach',
'cherry',
'coconut',
'papaya',
'plum',
'lemon',
'lime',
'grapefruit',
'guava',
'lychee',
'dragonfruit'
];
//create a variable to hold the array of data that is filtered by the input field value
let filteredData = [];
//create a variable to hold the array of data that is filtered by the input field value and is sorted by length of the string in descending order
let sortedData = [];
//create a variable to hold the array of data that is filtered by the input field value and is sorted by length of the string in descending order and is limited to 10 items only. This is used for the output field.
let limitedData = [];
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)