Sha256: 174f4dee4b92a2079fa1be7dd2df58b243e74cd22902882f012feb1bf7586563

Contents?: true

Size: 384 Bytes

Versions: 226

Compression:

Stored size: 384 Bytes

Contents

export default class Raindrops {
    convert(drops: number): string {
        let converted = ''

        if (drops % 3 === 0) {
            converted += 'Pling'
        }
        if (drops % 5 === 0) {
            converted += 'Plang'
        }
        if (drops % 7 === 0) {
            converted += 'Plong'
        }

        return converted ? converted : drops.toString()
    }
}

Version data entries

226 entries across 226 versions & 1 rubygems

Version Path
trackler-2.2.1.119 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.118 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.117 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.116 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.115 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.114 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.113 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.111 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.110 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.109 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.108 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.107 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.106 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.105 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.104 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.103 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.102 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.101 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.100 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.99 tracks/typescript/exercises/raindrops/raindrops.example.ts