How different are the semantics between Python and JavaScript?

后端 未结 6 1196
無奈伤痛
無奈伤痛 2021-01-30 09:36

Both these languages seem extremely similar to me. Although Python supports actual classes instead of being prototype-based, in Python classes are not all that different from f

6条回答
  •  日久生厌
    2021-01-30 09:42

    In python, "self" is explicitly passed to a member function, and is not a special keyword or anything. In javascript, "this" is dynamically scoped. you can fiddle with the scope of a member function by calling apply() on it.

提交回复
热议问题