|
Nope, `undefined` is not the answer.
Since `undefined == undefined` returns true in console.
|
|
|
|
|
Ok, I googled it. It's NaN!
Cheers!
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Your are very near, but this is not the exact answer
|
|
|
|
|
That's bullshit! I've tried it out and surely foo!=foo is true if foo is NaN.
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Yup, you are right but here foo is actually NaN, but the question is `What is type of foo`
So, the real answer is `number`
Since, typeof NaN returns "number"
Cheers!
|
|
|
|
|
Isn't it amazing, how NaN is a number, how a number is a word and how a word is a string.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
yup, the NaN stuff is amazing, but not sure about 'how a number is a word and how a word is a string'
|
|
|
|
|
Great that you already know the NaN is a number.
Now, if you have ever programmed in low-level, you would know that a word is a size given to a data, 1 byte, 2 byte etc. So the size of the register in CPU is a word; pre-defined size, doesn't matter 8-bit 16-bit or what. The size is number, thus, a number is word.
Now a word in our language, for example, "Hello", cannot be represented as a word in computer which needs some other type, which is string (array of characters), thus a word is a string. From here comes the metaphor,
In programming, a number is a word and a word is a string.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Do you have any reference documentations for it?
I want to learn about it more in-depth. Thanks!
|
|
|
|
|
Sure, read about Word in computer architecture[^] and the string data type[^]. One thing you should know is that there is no actual string type, it is just an array of characters.
Good luck for more in-depths.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Thanks for it. Have a nice day ahead!
|
|
|
|
|
Great explanation of how semantics and jargon are sometimes or often at odds with meaning.
|
|
|
|
|
Afzaal Ahmad Zeeshan wrote: Isn't it amazing, how NaN is a number Yes! Especially since NaN is short for "Not a Number"!
My whole life is a lie!
|
|
|
|
|
Clarified, but how is a number a word (the size of register) and how is a word actually a string (the data type)?
Plus, short form of your life is a lie (removing the F).
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
No, undefined compared with anything (anything includes also again undefined) is "an error" and therefore neither equal nor unequal... it is simply again undefined.
modified 19-Jan-21 21:04pm.
|
|
|
|
|
It's 2015, IEEE 754 is from 1985, how does this still surprise people after 30 years?
|
|
|
|
|
Any after overloading operators...
|
|
|
|
|
spoiler alert -- answer is below
Opened Chrome Dev console and ran the following.
var x = 'garbage' / 10;
x
NaN
x != x
true
x !== x
true
typeof(x)
"number"
|
|
|
|
|
Awesome
|
|
|
|
|
How about int ?
private static System.Random randy = new System.Random() ;
int foo { get { return ( randy.Next() ) ; } }
|
|
|
|
|
Or DateTime:
DateTime foo { get { return DateTime.Now; } }
|
|
|
|
|
|
Down (with Inchworm Action)
===================
Down in the boondocks used to be called sawbones about it's a long, long way to Tippecanoe and paddle boy he watched Sesame Street with Kermott the Hoopoe wrote the Raven maniacronymphomaniacrophobia good guy wireless Paul is dead KenneD. H. Lawrence Taylor Sheriff of Mayberry pie is not just 3.14etc. any more's law-abiding dong the witch is it live or is it memorhesus monkeys to the Kingdom and dumbo Derek and the Dominoes is growingwie Malmsteenager in Love on the Roxanne you don't have to turn it up and down
modified 11-Sep-15 12:47pm.
|
|
|
|
|
I am constantly trying to have metaphors to explain to business people what building software is, and why failures happen, and why having it sooner is NOT better than having it right.
I usually use hiring an architect to design a new building. Having to ask all the right questions about how it will be used, who will be using it (giants or little people, special needs, etc) all impact the design. And those decisions need to be made early. (ignoring waterfall vs. agile debates here).
Recently, I stumbled across someone looking for a "package" to run their shop. They wanted us to tell them which package they should go with, but we were there on an initial meeting. We told them it would be a horrible idea to proffer an opinion knowing so little about what they do, and about what they SHOULD be doing better.
After the meeting, I was pondering how to explain this to them.
So, I thought of the concept of saying. What you have now is a PLAY. You know all the scenes, the lines, the roles, the players. Now, to get to the next level, you need a Musical Score to accentuate that play, and allow people to be more engaged with what they are doing.
Don't you think, before the Music is written, that the Musicians should read/watch the play?
Should understand the meaning of the "Parts"?
Should know the entire story?
Should have a clue where the sequel might go?
I am curious about feedback to this line of thinking?
Does this make sense as a way to get people to understand that the final piece, if done well, adds extreme value, and if done poorly, by people who do not understand, will produce a poor result.
Just loading up Van Halen songs and playing them may be great for the one manager who loves Van Halen, but honestly, is that what they need?
|
|
|
|
|
... music comes from hydrogen bombs ...
|
|
|
|