|
Wow, so mere spacing can make a difference? Wtf! How do they even minify this with any expectation of consistency?
|
|
|
|
|
Nah, we just need to deprecate ASI. The community already shuns it, and I'm sure no one would bemoan its loss. Lots of JS devs are already fine with sticking 'use strict'; in all of their code. Let's just leverage that as a flag to tell the JS engine to turn it off.
modified 10-Oct-16 10:28am.
|
|
|
|
|
TypeScript FTW!
|
|
|
|
|
cheers
Chris Maunder
|
|
|
|
|
That's insane, Chris! You should make it a high priority to rewrite the site going back to VBScript. It worked fine then, and there's no reason that it would not work today, other than the overhead required to serve an additional 12 million members.
Will Rogers never met me.
|
|
|
|
|
Great findings there, Chris. I didn't know that it would make a difference when returning an object.
When writing JS code, I always do the K&R style of coding because I find it more clean and compact. I also do the same indention style with C#.
|
|
|
|
|
The tricky bit is here:
https://jsfiddle.net/vzmh2eL6/1/[^]
Returns `undefined`
Same thing happens if you use any other expression like:
return [1,2];
vs
return
[1,2];
This happens since based on Standard ECMA-262 5.1 Edition section [^]:
return [no LineTerminator here] Expression ;
we can not have any line terminators or new line between the return and the expression. If Expression is omitted, the return value is undefined. Otherwise, the return value is the value of Expression.
Hope it helps!
Regards,
Palash
modified 10-Oct-16 2:07am.
|
|
|
|
|
|
Palash Mondal_ wrote: This happens since based on Standard ECMA-262 5.1 Edition section [^]:
Actually, it is since the very beginning (v1.0). The end--of-line terminator was to help VB programmers; but it has caused all sorts of problems.
The issue is that there are effectively two forms of the return statement ...
return and
return expression;
|
|
|
|
|
You might like to see the difference between
var x =
{
a: 'Hello'
};
and
if (x)
{
a: 'hello'
};
The first creates an object (x) with a property (a) with a value ('hello')
The second is a statement with a label (a) pointing to an expression ('hello') which does nothing. Labels (except for case labels) are a feature that have never had any practical use in JavaScript.
|
|
|
|
|
Neat link, Chris! And an excellent job of discovery by Jonathan!
Will Rogers never met me.
|
|
|
|
|
Chris Maunder wrote: A Collection of JavaScript Gotchas
"The string replace function only replaces the first match, not all matches as you may expect"
This one took me like forever to find out . I have never coded in Javascript, but recently for some Google Forms scripts...
|
|
|
|
|
I think that's easier to see coming - I figured the reason out for the JavaScript in a second - than that these two records will be inserted with no error in MySql, where we have unique index (Name, Sex) :
Name Sex
------ ----
Brady null
Brady null
From the manual:
In MySQL, a UNIQUE index is one in which all values in the index must be distinct. An error occurs if you try to add a new row with a key that matches an existing row. The exception to this is that if a column in the index is allowed to contain NULL values, it can contain multiple NULL values. This exception does not apply to BDB tables, for which an indexed column allows only a single NULL.
|
|
|
|
|
Anybody had their hands on it already? Just started my very first baby steps with it, and I can say I like it so far. Host an ASP.Net MVC app in the console - That surely is neat to have, especially for smaller web apps / services.
JavaScript gives you a false sense of safety. It's like riding a bike with those little side wheels and then riding head first into a ravine.
Sander Rossel
|
|
|
|
|
Yes - we've been using it for a while on a side / play around project we'll be releasing soon and it's definitely has it's ups. And its downs.
Core 1.1 is what I'm waiting for, patiently. The changes with Core over the RC period was painful, but I'm very much looking forward to a fully platform independent codebase. Sorry Microsoft, but I'm tired of paying OS licencing. (and, frankly, tired of Bootcamp - being able to work on the same code on my Mac will be great)
Now if only the million, billion frontend frameworks, tools and libraries would settle down.
cheers
Chris Maunder
|
|
|
|
|
Chris Maunder wrote: Now if only the million, billion frontend frameworks, tools and libraries would settle down
But they did that! Silverlight was a fantastic library, one stop UI for the web. Not a myriad of disparate tech to decide amongst.
Then some stupid f***ing pillock decided that browser add ins were not the way to go. So now you have a dogs breakfast to sort through to get a tool set and the dog throws up on a regular basis.
And now they have me looking at hadoop and java bah humbug! Give me back my lovely desktop apps AAAaaaaahhhhhhh!!!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
My two cents is that I find the Yeoman ASP.NET scaffolding better than the Visual Studio one (it works cross platform with no modification for a start ).
I came into this game for the action, the excitement. Go anywhere, travel light, get in, get out, wherever there's trouble, a man alone. Now they got the whole country sectioned off, you can't make a move without a form.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
This woman is completely bonkers![^]
Seriously? She is nuts!
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
OK. We get it. All because of [Insert current/former/future POTUS here].
JavaScript gives you a false sense of safety. It's like riding a bike with those little side wheels and then riding head first into a ravine.
Sander Rossel
|
|
|
|
|
Perhaps consider that links to really horrible disgusting acts of violence and cruelty ... if your really get off on posting such things ... fit better in the SoapBox than the Lounge.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
I am more befuddled than anything. What was going through her head (if anything)?
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
A perfect example of evolution in action
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Perhaps she thinks her child is a squirrel?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Someone needs to put a steak through the heart of this vegan nonsense.
|
|
|
|
|