Created
July 6, 2017 16:00
-
-
Save edtoken/e748e92d51624217cc9ae6391d058433 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.codewars.com/kata/grill-it/train/javascript | |
function grille(message, code) { | |
let code_bin = (code >>> 0).toString(2); | |
let message_test = message.substr(-code_bin.length); | |
return Array.prototype.filter.call(message_test, (w, n) => (code_bin[n] == "1")).join('') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment