Multiple of 3 in array

const foo = (arr, n) => arr.filter((arr) => (arr % n === 0)) || false; console.log(foo([1, 2, 3, 4, 5, 6, 7, 8, 9], 3)); // > [3, 6, 9]
Find multiple of 3 in array numbers

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.