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.180 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.179 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.178 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.177 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.176 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.175 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.174 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.173 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.172 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.171 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.170 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.169 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.167 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.166 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.165 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.164 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.163 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.162 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.161 tracks/typescript/exercises/raindrops/raindrops.example.ts
trackler-2.2.1.160 tracks/typescript/exercises/raindrops/raindrops.example.ts