Sunday, 24 December 2017

Diffrance bitween == to and === in javascript

Example :

            var a= 99; // variable a assigned the integer value .
            var b="99"; // variable b assigned the string value .
            if(a==b)

                {
                console.log(" using == to : True");
                }
            else

                {
                console.log(" using == to : False");
                }
            if(a===b)
            {
                console.log(" using === to : True")
            }
            else

             {
                console.log(" using === to : False");
            }

    // == is just check value 
    // === is check value and its data type
   
 o/p : 
using == to : True
using === to : False


No comments:

Post a Comment

Django rest api - filter

views.py from django_filters.rest_framework import DjangoFilterBackend class PollList(viewsets.ModelViewSet):     queryset = X.objects...