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

Windows Phone 8 - Application bar command binding MVVM

This is a short post in which i will explain how on Windows phone 8 to bind the application bar button or menu item, first this is only a fix for the  BindableApplicationbar  which supports windows phone 7 only, i just made it support windows 8 no features added or anything. i have uploaded the dll file here so it can be accessible easily here is the link to download http://sdrv.ms/RApUal now that you got the link lets check how we gonna use it you can refer to BinableApplicationbar  or check out the code here that i actually used in my app and i already read it there !  Add a reference to the BindableApplicationBar library here is the link again  http://sdrv.ms/RApUal Add XML namespace declaration in your page's XAML: xmlns : bar ="clr-namespace:BindableApplicationBar;assembly=BindableApplicationBar" Set Bindable.ApplicationBar property on your page code as in the snippet below: < phone : PhoneApplicationPage >  ...

Windows 8 – XAML/C# how to Add multi push pins to map control Bing maps

Greetings readers I promised you in my previous post that I am gonna go a little bit deeper in the Bing map control and I will should more advanced scenarios and one is push pins, Basically I am going to tell you how you can add push pin to your map and also how to dynamically populate those push pins using binding Refer to my previous article Using bing maps part one  for more details cause I am going build on it so if you ever feel that you don’t understand something just click the link and spend a few minutes reading it, I promise you it will prove worthy. First lets add a normal push pin to our map  < Grid Background = " {StaticResource ApplicationPageBackgroundThemeBrush} " > < bm : Map x:Name = " MyMap " Width = " 640 " Height = " 480 " Credentials = " {StaticResource BingMapsApiKey} " > < bm : Map.Children > < bm : Pushpin x:Name = ...

Xamarin Forms: XAML Creating Custom Controls The MVVM Way

Intro For a growing UI page there always comes a need to create sub views that can be used inside a bigger view, and for that we need custom controls, which are controls that are derived either from a layout or a simple view which is the basic control for almost any UI component in Xamarin forms, and therefore for a start i will use that as an example. And in such example we will create a custom control with a set of bindable properties and explain how they work, also how to add an event that can also be bound to Commands Lets Create the control  I have just went ahead and created a custom control that inherits from Xamarin.Forms.View and have some properties such color and checked all properties to be bound to by the ViewModel serving as the datacontext of the this control. here is the code below using System; using Xamarin.Forms; namespace UserControls { public class CustomView : View { public Color Color { get ; s...