DEV Community

Discussion on: Coding Concepts - Reflection

Collapse
 
kayis profile image
K

Good writeup :)

After using reflection in Java and PHP I had the impression that JavaScript is even better in that way, because classes are implemented dynamically and can be accessed without extra magic, almost homoiconic.

Collapse
 
chris_bertrand profile image
Chris Bertrand

JavaScript and reflection is an interesting concept, as JavaScript doesnt really have the notion of classes,as everything is an object and already being a dynamic language things get a bit murky.

But ES5 and more so ES6 do contain a Reflection Api. This great article goes way more in depth on the topic then i ever could: ponyfoo.com/articles/es6-reflectio...

Collapse
 
nans profile image
Nans Dumortier

Thanks Chris for the reference to ponyfoo.com ! I didn't know that website, and will definitely hang out there more often !

Thread Thread
 
chris_bertrand profile image
Chris Bertrand

It's great right! Looks like it's had a visual overhaul since I posted this too! Looks even better now.

Thread Thread
 
nans profile image
Nans Dumortier

Yup, and it's a PWA too so I feel even better browsing it 😁