You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
显而易见,2被误认为成了一个方法名,所以被认为是在执行方法'2',但2其实是个数字,所以才会报2 is not a function 的错。因此如果在2后面加上 ; 的时候,结果就完全不一样了,或者说就符合这段代码本身该有的亚子了:
像这种错误其实日常开发中稍微不注意就很容易出现,所以除了掌握js正常情况下的语法之外,还需要考虑运行情况下可能会出现的问题。
No description provided.
The text was updated successfully, but these errors were encountered: