脚本语言中的代码的技术术语是什么,它不属于任何函数并且在导入脚本时首先执行?
例如,在 python 中:
import anything
#what is the technical name for this code?
a = 1
doABackFlip()
def myFunction():
#Not this code since it is part of a function
b = 2
runSomething()
class myClass():
#This is in a class so not this code either
在 JavaScript 中:
<script>
//What is the technical name of this code?
a = 1
doABarrelRoll()
function myFunction() {
//Not this stuff. Part of a function again
doSomethingCool()
}
</script>
我正在专门为此代码寻找一两个词的术语。如果它是常用的描述符或更好的描述符,那将是最好的,这是在 60 年代的一些学术论文中创造的。