Richard Cornford wrote:
behaviour that is specified, consistent, reliable and
completely predictable.
Does it mean that any properly reported bug becomes a legitimate
feature? :-) Because your description fits perfectly for a bug listed
at say Microsoft KB or Bugzilla, acknowledged by producer, having a
written workaround.
Yet there are different opinions on the incontinence of [this] problem,
so I'm using a neutral term "phenomenon" for it. After all say Eskimos
too paddle face forward and they consider white people paddling with
all another part of body forward totally ridiculous. Who's right, who's
wrong - no one, really - it's all question of traditions.
You have also still not understood that the criteria for 'off topic' is
determined by the topic of the group (i.e. javascript) not by the subject
headers of any particular thread.
That can be true for some "What is true love?" public forum :-), but
for a technical newsgroup the discussion should stay on the subject: or
simply change the subject line accordingly to go on a new branch, or
better yet start a new discussion. Whoever will search the archives for
an answer do not necessary have to read all and every side posts.
function foo(){} vs. var foo = function(){}
In both cases a function object is created and a reference to
that function is assigned to a property of the Activation/Variable object
for the execution context. The implications for memory consumption are
identical in both cases.
I did not mean any memory consumption considerations, they are
negligible. There are other fine-tune effects you have to account
sometimes.
In the first case we have a function declaration. In the second case we
have an assignment, so the right-hand expression is being evaluated and
the result assigned to the left-hand operator. The result of a function
expression is a reference to the function just created during the
evaluation. If you have any IE handy (or Netscape 3.x - 6.x) you can
see the difference even without any monitoring software. Simply use a
named function instead of anonymous one in your expression:
<html>
<head>
<title>Demo</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<script type="text/javascript">
var bar = void function f(){};
alert(typeof bar);
alert(typeof f);
</script>
</head>
<body>
</body>
</html>
void prevents bar from receiving evaluation result, but it doesn't stop
"function f(){};" expression to create new function object.
On Firefox and Opera it can be tricky to see that, because they have
patched function expression visibility scope to be in accordance with
ECMAScript prescriptions. Here you need some monitoring software.
Once again: it is not about memory usage, the difference is negligible.