Skip to main content
Commonmark migration
Source Link

#JavaScript (ES6), 73 54 50 bytes

JavaScript (ES6), 73 54 50 bytes

(Saved some bytes thanks to @LeakyNun, the edited challenge, and @CraigAyre.)

s=>s.match(/../g).map((c,i)=>('0x'+c)/(i-3?1:255))

let f=

s=>s.match(/../g).map((c,i)=>('0x'+c)/(i-3?1:255))

console.log(f('00ff0080'));

#JavaScript (ES6), 73 54 50 bytes

(Saved some bytes thanks to @LeakyNun, the edited challenge, and @CraigAyre.)

s=>s.match(/../g).map((c,i)=>('0x'+c)/(i-3?1:255))

let f=

s=>s.match(/../g).map((c,i)=>('0x'+c)/(i-3?1:255))

console.log(f('00ff0080'));

JavaScript (ES6), 73 54 50 bytes

(Saved some bytes thanks to @LeakyNun, the edited challenge, and @CraigAyre.)

s=>s.match(/../g).map((c,i)=>('0x'+c)/(i-3?1:255))

let f=

s=>s.match(/../g).map((c,i)=>('0x'+c)/(i-3?1:255))

console.log(f('00ff0080'));

deleted 5 characters in body
Source Link
Rick Hitchcock
  • 2.6k
  • 12
  • 18

#JavaScript (ES6), 73 54 5150 bytes

(Saved some bytes thanks to @LeakyNun, the edited challenge, and @CraigAyre.)

s=>s.match(/../g).map((c,i)=>eval=>('0x'+c)/(i-3?1:255))

let f=

s=>s.match(/../g).map((c,i)=>+=>('0x'+c)/(i-3?1:255))

console.log(f('00ff0080'));

#JavaScript (ES6), 73 54 51 bytes

(Saved some bytes thanks to @LeakyNun, the edited challenge, and @CraigAyre.)

s=>s.match(/../g).map((c,i)=>eval('0x'+c)/(i-3?1:255))

let f=

s=>s.match(/../g).map((c,i)=>+('0x'+c)/(i-3?1:255))

console.log(f('00ff0080'));

#JavaScript (ES6), 73 54 50 bytes

(Saved some bytes thanks to @LeakyNun, the edited challenge, and @CraigAyre.)

s=>s.match(/../g).map((c,i)=>('0x'+c)/(i-3?1:255))

let f=

s=>s.match(/../g).map((c,i)=>('0x'+c)/(i-3?1:255))

console.log(f('00ff0080'));

added 5 characters in body
Source Link
Rick Hitchcock
  • 2.6k
  • 12
  • 18

#JavaScript (ES6), 73 5454 51 bytes

(Saved some bytes thanks to @LeakyNun, the edited challenge, and @CraigAyre.)

s=>s.match(/../g).map((c,i)=>eval('0x'+c)/(i-3?1:255))

let f=

s=>s.match(/../g).map((c,i)=>eval=>+('0x'+c)/(i-3?1:255))

console.log(f('00ff0080'));

#JavaScript (ES6), 73 54 bytes

(Saved some bytes thanks to @LeakyNun, the edited challenge, and @CraigAyre.)

s=>s.match(/../g).map((c,i)=>eval('0x'+c)/(i-3?1:255))

let f=

s=>s.match(/../g).map((c,i)=>eval('0x'+c)/(i-3?1:255))

console.log(f('00ff0080'));

#JavaScript (ES6), 73 54 51 bytes

(Saved some bytes thanks to @LeakyNun, the edited challenge, and @CraigAyre.)

s=>s.match(/../g).map((c,i)=>eval('0x'+c)/(i-3?1:255))

let f=

s=>s.match(/../g).map((c,i)=>+('0x'+c)/(i-3?1:255))

console.log(f('00ff0080'));

deleted 5 characters in body
Source Link
Rick Hitchcock
  • 2.6k
  • 12
  • 18
Loading
edited body
Source Link
Rick Hitchcock
  • 2.6k
  • 12
  • 18
Loading
deleted 65 characters in body
Source Link
Rick Hitchcock
  • 2.6k
  • 12
  • 18
Loading
added 87 characters in body
Source Link
Rick Hitchcock
  • 2.6k
  • 12
  • 18
Loading
added 27 characters in body
Source Link
Rick Hitchcock
  • 2.6k
  • 12
  • 18
Loading
Source Link
Rick Hitchcock
  • 2.6k
  • 12
  • 18
Loading