fianyx

JS

Jul 25th, 2025
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.65 KB | Source Code | 0 0
  1. function hasil(kalimat) {
  2.   return Math.max(
  3.     ...kalimat.map(k => k.replace(/[.,]/g, '').split(' ').length)
  4.   );
  5. }
  6.  
  7. const kalimat = [
  8.   'Mauris ultricies sed sapien eget malesuada. Suspendisse et aliquet odio, id ultrices erat. Praesent vehicula adalah nulla. Aliquam sebuah lorem urna. Selesai.',
  9.   'Duis di tellus et ex bibendum pellentesque sed in nibh. Sed aliquet, diam id mollis facilisis, massa metus accumsan elit, dan mattis magna.',
  10.   'Sed non nibh quam. Pellentesque eget ultrices diam. Aliquam diam justo, consectetur ac dui lobortis, vestibulum bibendum lorem. Hanya porta pulvinar.',
  11. ];
  12.  
  13. console.log(hasil(kalimat)); // Output: 23
  14.  
Tags: js
Advertisement
Add Comment
Please, Sign In to add comment
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy