We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2528636 commit 46d772fCopy full SHA for 46d772f
raindrops/raindrops.js
@@ -1,8 +1,14 @@
1
-//
2
-// This is only a SKELETON file for the 'Raindrops' exercise. It's been provided as a
3
-// convenience to get you started writing code faster.
4
+export const convert = (input) => {
+ let result = '';
5
6
-export const convert = () => {
7
- throw new Error("Remove this statement and implement this function");
+ if (input % 3 === 0) {
+ result = result + 'Pling';
+ }
+ if (input % 5 === 0) {
8
+ result = result + 'Plang';
9
10
+ if (input % 7 === 0) {
11
+ result = result + 'Plong';
12
13
+ return result.length > 0 ? result : input.toString();
14
};
0 commit comments