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


1
Expert's answer
2021-11-27T11:37:13-0500
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!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS