"12345" * 1 === 12345 // string * number => number
强类型 意味着存在一个编译器,它希望将 绳子显式转换为 整数。
(int) "12345" * 1 === 12345
In either case, some compiler's features can implicitly alter the instruction during compile-time to do conversions for you, if it can determine that is the right thing to do.
Dynamically typed means the 价值's type is enforced, but the variable simply represents any value of any type.
x = 12345; // number
x = "string"; // string
x = { key: "value" }; // object
y = 123 + x; // error or implicit conversion must take place.
Statically typed means the 变量 type is strongly enforced, and the value type is less-so enforced.
int x = 12345; // binds x to the type int
x = "string"; // too late, x is an integer - error
string y = 123; // error or implicit conversion must take place.
The other definition is from Programming Language Theory (the academic thing that Brendan is referring to). In this domain, 无法打印 just means 所有东西都属于同一种类型.