功能问题 [英] Functional question
问题描述
这两个会产生不同的结果吗?
function positive(){return true; }
var positive = function(){return true; }
Ma * ***********@gmail.com meinte:
这两个会产生不同的结果吗?
function positive(){return true; }
var positive = function(){return true; }
No.
Gregor
-
http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
http://web.gregorkofler.com ::: meine JS-Spielwiese
http://www.image2d.com :::Bildagenturfürdenalpinen Raum
>> no
我应该多大程度地解释一下:
没有功能差异?
没有任何区别?
没有微妙的浏览器不兼容性?
Ma ************ @ gmail.com meinte:
< blockquote class =post_quotes>
>> no
我应该有多强烈地理解:
答案与你的问题一样精确。
>
请在此处阅读:
http:// javascript.crockford.com/survey.html
并向下滚动到功能。
没有功能差异?
我不确定你的意思是功能差异,但我会说不。
没有任何区别?
不同的源代码。第二个版本应该在语句的
结尾处加一个分号。
没有微妙的浏览器不兼容性?
我认为这是bog standard-JS,我想每个JS
实现都能正确处理这两个版本。也许PointedEars
会告诉你最早的JS版本,并且当你的意思是JS实现时,你不应该要求浏览器。
Gregor
-
http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
http://web.gregorkofler.com ::: meine JS-Spielwiese
http://www.image2d.com :::Bildagenturfürdenalpinen Raum
Do these two give a different result?
function positive() { return true; }
var positive = function() { return true; }
Ma************@gmail.com meinte:Do these two give a different result?
function positive() { return true; }
var positive = function() { return true; }No.
Gregor
--
http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
http://web.gregorkofler.com ::: meine JS-Spielwiese
http://www.image2d.com ::: Bildagentur für den alpinen Raum
>>no
How strongly should I interpret that:
No functional difference?
No difference whatsoever?
No subtle browser incompatibilities?
Ma************@gmail.com meinte:>>no
How strongly should I interpret that:The answer is about as precise as your question.
Read here:
http://javascript.crockford.com/survey.html
and scroll down to "Functions".
No functional difference?I''m not sure what you mean by "functional difference", but I''d say no.
No difference whatsoever?Different source code. The second version should take a semicolon at the
end of the statement.
No subtle browser incompatibilities?I suppose this is "bog standard"-JS, and I suppose every JS
implementation will handle both versions properly. Maybe PointedEars
will tell you about the earliest JS version capable of both, and that
you shouldn''t ask for browsers, when you mean JS implementations.
Gregor
--
http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
http://web.gregorkofler.com ::: meine JS-Spielwiese
http://www.image2d.com ::: Bildagentur für den alpinen Raum
这篇关于功能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!