Skip to main content
Updated submission
Source Link
Eliseo D'Annunzio
  • 7.5k
  • 1
  • 36
  • 73

JavaScript ES5ES6 ES5, 2123 1517 12

12 bytes

`${!3}`[3-2]

17 bytes: (typeof!3)[2- -3]

23 bytes: _=()=>(typeof!3)[2+3][2- -3]

Edit 05/10/2016: Took advantage of templating strings, as well as boolean coercion and string/array indexing... Also realized my previous code used (typeof!+, I could always salvage 2+3 as 2- -3)[2+3] at a cost of 2 bytes for each previous example... (Updated code and scores for previous submissions)

Edit 30/08/2016:

I took a different approach, exploiting the fat arrow functions as well as the typeof return type, which is a string. So converting a number to a boolean was easier then, had to encase it in parentheses before pulling the 5th element of the resulting string...

Edit 30/08/2016: Seems that there was no mention of my answer requiring to be in the form of a function, so I've just stripped the fat arrow function declaration.

JavaScript ES5, 21 15

_=()=>(typeof!3)[2+3]

(typeof!3)[2+3]

I took a different approach, exploiting the fat arrow functions as well as the typeof return type, which is a string. So converting a number to a boolean was easier then, had to encase it in parentheses before pulling the 5th element of the resulting string...

Edit 30/08/2016: Seems that there was no mention of my answer requiring to be in the form of a function, so I've just stripped the fat arrow function declaration.

JavaScript ES6 ES5, 23 17 12

12 bytes

`${!3}`[3-2]

17 bytes: (typeof!3)[2- -3]

23 bytes: _=()=>(typeof!3)[2- -3]

Edit 05/10/2016: Took advantage of templating strings, as well as boolean coercion and string/array indexing... Also realized my previous code used +, I could always salvage 2+3 as 2- -3 at a cost of 2 bytes for each previous example... (Updated code and scores for previous submissions)

Edit 30/08/2016:

I took a different approach, exploiting the fat arrow functions as well as the typeof return type, which is a string. So converting a number to a boolean was easier then, had to encase it in parentheses before pulling the 5th element of the resulting string...

Seems that there was no mention of my answer requiring to be in the form of a function, so I've just stripped the fat arrow function declaration.

added 208 characters in body
Source Link
Eliseo D'Annunzio
  • 7.5k
  • 1
  • 36
  • 73

JavaScript ES5, 2121 15

_=()=>(typeof!3)[2+3]

_=()=>(typeof!3)[2+3]

I took a different approach, exploiting the fat arrow functions as well as the typeof return type, which is a string. So converting a number to a boolean was easier then, had to encase it in parentheses before pulling the 5th element of the resulting string...

Edit 30/08/2016: Seems that there was no mention of my answer requiring to be in the form of a function, so I've just stripped the fat arrow function declaration.

JavaScript ES5, 21

_=()=>(typeof!3)[2+3]

I took a different approach, exploiting the fat arrow functions as well as the typeof return type, which is a string. So converting a number to a boolean was easier then, had to encase it in parentheses before pulling the 5th element of the resulting string...

JavaScript ES5, 21 15

_=()=>(typeof!3)[2+3]

(typeof!3)[2+3]

I took a different approach, exploiting the fat arrow functions as well as the typeof return type, which is a string. So converting a number to a boolean was easier then, had to encase it in parentheses before pulling the 5th element of the resulting string...

Edit 30/08/2016: Seems that there was no mention of my answer requiring to be in the form of a function, so I've just stripped the fat arrow function declaration.

deleted 1 character in body
Source Link
Eliseo D'Annunzio
  • 7.5k
  • 1
  • 36
  • 73

JavaScript ES5, 2521

_=(typeof)=>(!typeof!(3-3)))[2+3]

I took a different approach, exploiting the fat arrow functions as well as the typeof return type, which is a string. So converting a number to a boolean was easier then, had to encase it in parentheses before pulling the 5th element of the resulting string...

JavaScript ES5, 25

(typeof(!!(3-3)))[2+3]

I took a different approach, exploiting the fat arrow functions as well as the typeof return type, which is a string. So converting a number to a boolean was easier then, had to encase it in parentheses before pulling the 5th element of the resulting string...

JavaScript ES5, 21

_=()=>(typeof!3)[2+3]

I took a different approach, exploiting the fat arrow functions as well as the typeof return type, which is a string. So converting a number to a boolean was easier then, had to encase it in parentheses before pulling the 5th element of the resulting string...

Source Link
Eliseo D'Annunzio
  • 7.5k
  • 1
  • 36
  • 73
Loading