summary refs log tree commit diff stats
path: root/javascript/raindrops/raindrops.js
blob: f8dff049b7d330110354afb1b8817d7d230265cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
'use strict';

export const convert = (num) => {
    let drops = "";
    if (num % 3 == 0) drops += "Pling";
    if (num % 5 == 0) drops += "Plang";
    if (num % 7 == 0) drops += "Plong";

    if (drops.length == 0) drops += num;
    return drops;
};