是否有一个javascript等效的python pass语句什么都不做?
问题描述:
我正在寻找一个没有做任何事情的python 传递
语句的javascript等价物。 javascript中有这样的东西吗?
I am looking for a javascript equivalent for the python pass
statement that does nothing. Is there such a thing in javascript?
答
Python的传递
主要存在,因为在Python中的空白内容很重要。在Javascript中,等效的是在块内没有任何内容,即 {}
。
Python's pass
mainly exists because in Python whitespace matters within a block. In Javascript, the equivalent would be putting nothing within the block, i.e. {}
.