Comment

Comment by belandrew

> Python is more dynamic than JavaScript, in that it has __getattr__, __setattr__, __getitem__, etc.

No, it's not. You can do equivalents to all of those in Javascript. Javascript objects are all mutable with a few exceptions. They are just maps of properties, very similar to Python's. Properties can be added or changed at runtime.

For example, setattr(obj, item, value) in python is basically just obj[item] = value in js.

parent belandrew 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton