gpt4 book ai didi

javascript - 为什么 JavaScript 被称为 "scripting language"?

转载 作者:行者123 更新时间:2023-12-03 01:56:27 25 4
gpt4 key购买 nike

正如标题所说,我想知道JavaScript被称为“脚本语言”的确切原因?

我的理解是这是因为 JavaScript 仅由浏览器解释(而不是编译)。如果我错了请纠正我。

但是如果没有编译那么0 == ''怎么会是true呢?编译器不会强制这些值,还是 JavaScript 引擎......?我有点困惑。

最佳答案

我认为前两句话来自 wikipedia足够清楚了:

A scripting language, script language or extension language is a programming language that allows some control of a single or many software application(s). Languages chosen for scripting purposes are often much higher-level than the language used by the host application...

在本例中,应用程序是浏览器。关于编译:

Scripts are often, but not always, interpreted from the source code or "semi-compiled" to bytecode which is interpreted, unlike the applications they are associated with, which are traditionally compiled to native machine code for the system on which they run

关于0等于'',它的强制转换不一定是由编译器实现的;这一切都与运行时的 JavaScript 引擎有关。

我对从维基百科获取所有内容感到抱歉,但它是如此清晰,我将其引用

PS:我发现也值得粘贴此内容:

Many people view 'scripting' languages as inferior or somehow different than languages that haven't achieved popularity on the scripting scene. Ironically, these same languages were carefully chosen for scripting due to their quality and versatility.

关于javascript - 为什么 JavaScript 被称为 "scripting language"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/968461/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com