Question #272481

Given a stringarray of string and startstring,endstring as input writen js program to fliter the string in stringArray start with startstring and end with endstring


Expert's answer

function main() {
    const stringsArray = JSON.parse(readLine().replace(/'/g'"'));
    const startString = readLine();
    const endString = readLine();
    /* Write your code here */

    const outputArray = stringsArray.filteritem => item.startsWith(startString) || item.endsWith(endString) );

    console.log(outputArray);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS