Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
1 answer
32 views

Triple equal measure the value as well as type. But I want to know the order like it first compares the value and returns on false or vice versa.
Muhammad Arqam's user avatar
0 votes
0 answers
293 views

I want to write a function to trim additional decimal 0's from floating point numbers like 2.0, 5.00 but not 3.04. so I wrote this: const trimZeroFromDecimal = value => parseInt(value) === value ...
Probosckie's user avatar
  • 1,832
0 votes
0 answers
66 views

So I understand that FMOD gives some wacky answers sometimes because its sort of approximate. But even given that I'm struggling to utilize the answers it throws up later-on in the code. For instance, ...
tornadohenry's user avatar
0 votes
1 answer
63 views

I have an array like this: var str = "This is an example sentence with the number 1"; var array = str.split(' '); // array[8] should be 1 Now i want to check, if a certain variable is the ...
Frosty's user avatar
  • 51
0 votes
0 answers
34 views

It's a known fact in Js that the value NaN is not equal to itself console.log(NaN === NaN) // false Which other Javascript literal values are not equal to themselves - or is NaN the only value?? I'...
Probosckie's user avatar
  • 1,832
1 vote
4 answers
1k views

I have spent a while searching on Google for a non-Cats triple equals method, but can't find anything apart from Scalaz. Unfortunately, I have been unable to work out the import for === in this ...
J Hubbard's user avatar
  • 107
4 votes
7 answers
110 views

console.log(false === 0) // false console.log(false === !1) // true, why does it equate to true using !? and vice versa for console.log(true === 1 ) // false console.log(true === !0) // true I ...
Akshat Jain's user avatar
1 vote
1 answer
59 views

I'm starting to learn javascript for front-end programming, being python my first language to learn completely. So I'm trying to solve a while loop excersise that console-logs every number from 50-...
Nicolas Quiroz's user avatar
2 votes
1 answer
7k views

The following code gives TRUE,FALSE,FALSE,FALSE, I dont understand the TRUE response on empty arrays. Someone has an explanation? $results=array(); // Case 1 : Empty array $myArray=array(); ...
tit's user avatar
  • 619
8 votes
5 answers
2k views

I had been going through the ES6 assuming that it would be easy to switch to EcmaScript 2017. While going through, I got confused about this code function f (x, y = 7, z = 42) { return x + y + z ...
Tirthraj Barot's user avatar
2 votes
1 answer
3k views

In JavaScript code I want to replace the double-equals structure of the following if-statement: if( name == null ) { //do stuff } The double equals fail for the jshint rule "eqeqeq", where it's ...
Jesper Rønn-Jensen's user avatar
-1 votes
3 answers
852 views

I understand that == in JavaScript is comparison with type coercion. And I know that the following statements are true: '' == false; ' ' == false; '0' == false; '\n' == false; However, I can't get a ...
at.'s user avatar
  • 52.8k
0 votes
1 answer
101 views

I'm checking over my code for uses of == instead of ===, but changing this line: if(window.location == 'app:/test.html') To this: if(window.location === 'app:/test.html') Results in the block no ...
Danny Beckett's user avatar
1 vote
1 answer
560 views

I am learning scala, and want to write my tests with ===. However, I am curious if there is a way to do something like this: assert(1 !=== 2) I have tried the above, !==, and !(===) Is there any way ...
Justin Pihony's user avatar
4 votes
2 answers
2k views

Can somebody explain this? 1 == 1 //true, as expected 1 === 1 //true, as expected 1 == 1 == 1 //true, as expected 1 == 1 == 2 //false, as expected 1 === 1 === 2 //false, as expected ...
user avatar
4 votes
3 answers
775 views

Reading through the source code of underscore.js I stumbled upon the following line: ... if (obj.length === +obj.length) { ... That's a bit confusing for me. What is actually being compared here? I ...
Saintali's user avatar
  • 4,581
18 votes
1 answer
3k views

How do I do a ===/strict equals comparison in phpunit?
Matthew Flaschen's user avatar