Skip to content

Instantly share code, notes, and snippets.

View mikepc's full-sized avatar

Michael Draper mikepc

  • Cint
  • Seattle, WA
  • 15:43 (UTC -07:00)
View GitHub Profile
@mikepc
mikepc / index.js
Last active February 22, 2018 05:04
Coding Challenge, buffer problem
//Author: Michael Draper <mdraper@gmail.com>
//Justifies a string into a buffer.
// I ran it on Node v9.5.0 in ES2017 syntax.
const isInt = (n) => {
return n % 1 === 0;
}
//Example: justify('The quick brown fox jumps over the lazy dog', 52)
const justify = (str, len) => {
if(typeof(str) !== 'string'){