WEB_DEVELOPERSZZ Telegram 252
Javascript Reduce method Example.

▫️ Finding the longest word in a given string.

function longerWord(a, b) {
if (a.length > b.length) {
return a;
} else {
return b;
}
}

const sentence = 'Hey there what are you doing this Wednesday night';

const longest = sentence.split(' ').reduce(longerWord);

console.log(longest);

// Wednesday

#JavaScript #Reduce

(👥) • @Web_developersz
(📚) • @Web_developerszz



tgoop.com/Web_developerszz/252
Create:
Last Update:

Javascript Reduce method Example.

▫️ Finding the longest word in a given string.

function longerWord(a, b) {
if (a.length > b.length) {
return a;
} else {
return b;
}
}

const sentence = 'Hey there what are you doing this Wednesday night';

const longest = sentence.split(' ').reduce(longerWord);

console.log(longest);

// Wednesday

#JavaScript #Reduce

(👥) • @Web_developersz
(📚) • @Web_developerszz

BY Web Developer


Share with your friend now:
tgoop.com/Web_developerszz/252

View MORE
Open in Telegram


Telegram News

Date: |

Step-by-step tutorial on desktop: Done! Now you’re the proud owner of a Telegram channel. The next step is to set up and customize your channel. Some Telegram Channels content management tips For crypto enthusiasts, there was the “gm” app, a self-described “meme app” which only allowed users to greet each other with “gm,” or “good morning,” a common acronym thrown around on Crypto Twitter and Discord. But the gm app was shut down back in September after a hacker reportedly gained access to user data. SUCK Channel Telegram
from us


Telegram Web Developer
FROM American