Skip to content

Instantly share code, notes, and snippets.

@abdmmar
Last active April 22, 2023 13:52
Show Gist options
  • Select an option

  • Save abdmmar/c2db03795d9ac910c53976c8853c4559 to your computer and use it in GitHub Desktop.

Select an option

Save abdmmar/c2db03795d9ac910c53976c8853c4559 to your computer and use it in GitHub Desktop.
Hal-hal yang saya temukan ketika mengerjakan latihan dari Codility

1. Binary Gap

Convert int to string menggunakan toString(2)

// 1
console.log((302).toString(2)) // 100101110

let n = 302
console.log(n.toString(2)) // 100101110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment