Brutkey

Hazelnoot
@hazelnoot@enby.life

I have created the perfect JavaScript data type: a value that is both an object, a function, and a promise. All at the same time!

#JavaScript


Julian Gonggrijp
@juliangonggrijp@ieji.de

@hazelnoot@enby.life functions and promises are always objects, aren't they? But something that is both a promise and a function at the same time does seem exotic. How did you do it, did you use a proxy or something?

Marielle
@Chishiki611@enby.life

@hazelnoot This is nothing new fyi - if your object implements then()/catch(), it can be used like a promise.

Julian Gonggrijp
@juliangonggrijp@ieji.de

@Chishiki611@enby.life @hazelnoot@enby.life Oh right, that would work too.

Julian Gonggrijp
@juliangonggrijp@ieji.de

@Chishiki611@enby.life @hazelnoot@enby.life Oh right, that would work too.