Skip to main content

The Deference between == and === in javascript boolean and bool in c#

Brief,
I have been keeping a list of things i wonder about about operators and things we usually use while coding and in the end, we dont know exactly there usage.
For one is == and === in Javascript what is the deference?
Answer
=== operator is type concerned operator so if it is used the two parties of comparison should be the same as each in matter of value and type for booleans they have to be same value false or true and they have to be booleans for strings same characters length positions and same type
for instance
1===1 true
1 === "1" false cause they are not the same type
* in order for the condition to be true the two parties must refer to the same object


== operator has nothing to do with the type if the value is the same, it checks only for the value and never minds the type
* in order for the condition to be true the two parties must be of the same value

C# boolean and bool
the answer is shocking
there is not deference bool is an alias to system.boolean list int is alias to system.int32
hope you are not disappointed

Comments

Popular posts from this blog

(AsyncWebClient) Async Webclient for windows phone 8

Using windows phone web client is pretty common but the thing is you can not use it using Async -> Await mechanism so i used threading to create an async functionality for The Download string and upload string methods here is the code below // Comment public class AsyncWebClient { public Task DownloadString(Uri uri) { var task = new TaskCompletionSource(); try { var client = new WebClient(); client.DownloadStringCompleted += (s, e) => { task.SetResult(e.Result); }; client.DownloadStringAsync(uri); } catch (Exception ex) { task.SetException(ex); } return task.Task; } public Task UploadString(Uri uri, string content) { var task = new TaskCompletionSource(); try { var client…

RuntimeBinderException cannot resolver property in Unit Test in case of dynamic return.. Solved

Xamarin UI Tests – Deep dive Part 1

IntroAs the title may describe this is the first of the series of articles that will cover the UI Test of Xamarin in a deep dive, we will start simple and then dig deeper as we go. Since this is very well the first of the series, it will mostly cover up the architecture and the testing technique that Xamarin UI Tests uses.

The Technology
Xamarin UI Test is an automation testing framework similar to selenium, Watir, Watin (.net), Robot and Sikuli, if you have used BDD (Behavioral Driven Development) or a more advanced TDD (Test Driven Development) approach at least you must have come across one of these frameworks, and in that perspective comes Xamarin UI Testing as an automation framework designed specifically for Xamarin Automation testing, For starter Xamarin UI Tests was not build from scratch, instead it was built on top of another UI Automation testing framework that is targeting android and iOS sepecifically which is Calabash, I have to say that this choice was made wisely as of n…