我试图解释编写时间线代码与文档类代码之间的区别,到目前为止我有:
Timeline code:
- doesn't require a package and class declaration
Document Class code:
- requires a package and class declaration
Timeline code:
- starts working on the top-most line
Document Class Code:
- starts working from the constructor function
Timeline code:
- loops, conditionals and event listeners can be **outside** of a function
Document Class Code:
- loops, conditionals and event listeners must be **inside** a function
这些是正确的吗?还有什么东西会绊倒正在转型的人吗?