Showing posts with label JavaScript Interview Question. Show all posts
Showing posts with label JavaScript Interview Question. Show all posts

Friday, March 27, 2020

Difference Betwixt == Together With === Equal Operator Inwards Javascript

In 1 of the recent JavaScript interview for a Java spider web evolution position, 1 of my readers was asked this questions, What is the divergence betwixt comparing variables inward JavaScript using "==" together with "===" operator?  My reader got shocked because he was from Java background together with doesn't receive got slap-up exposure to JavaScript, though he was pretty much familiar alongside to a greater extent than or less JavaScript function, trial handling, together with to a greater extent than or less jQuery tricks, he wasn't aware of subtle details of JavaScript. He did the right think, politely said that he is non aware of the difference betwixt == together with === operator. Though It did non impact his interview performance much, he was keen to know virtually this equally before long equally he finished his interview. He asked to me equally well, together with that's the argue of this post. In 1 word, main divergence betwixt "==" together with "===" operator is that formerly compares variable past times making type correction e.g. if y'all compare a number alongside a string alongside numeric literal, == allows that, but === doesn't let that, because it non alone checks the value but also type of 2 variable, if 2 variables are non of the same type "===" furnish false, piece "==" furnish true. 

We volition run across couple of illustration of both operator inward this article, to empathize divergence betwixt them much better.





Difference betwixt == together with ===  inward JavaScript

Since JavaScript back upward both strict equality together with type-converting equality, it's of import to know which operator is used for which operation. As I said that, === takes type of variable inward consideration, piece == brand type correction based upon values of variables, next are duet of to a greater extent than differences betwixt "==" together with "===" operator inward JavaScript programming linguistic communication :

1) When nosotros compare 2 variables of dissimilar type e.g. a boolean alongside a string or a number alongside String using == operator, it automatically converts 1 type into to a greater extent than or less other together with furnish value based upon content equality, piece === operator is strict equality operator inward Java, together with alone furnish truthful if both variable of same type together with also contains same value. This volition last much clear alongside following illustration of == together with === operator inward JavaScript :

0==false   // true, because imitation is equivalent of 0 0===false  // false, because both operands are of dissimilar type 2=="2"     // true, car type coercion, string converted into number 2==="2"    // false, since both operands are non of same type

2)  "==" operator is known equally type coercion operator together with anytime if both values are same together with compared using ==operator, type coercion happens. On the other mitt === is known equally strictly equality operator. It's much like Java's equality operator (==), which gives compilation fault if y'all compare 2 variables, whose types are non compatible to each other. In fact, y'all should e'er work "===" operator for comparing variables or but for whatsoever comparison.

3)  While comparing variable using strict equality operator inward Java, 2 object are strictly equal to each other if both are of same type together with they refer to same instance. Similarly 2 String are equal to each other if contents of each others are same e.g. same characters at same position. Another skillful follow-up inquiry is what would last number of comparing zip together with undefined using == together with === operator inward JavaScript. Well response is simple, when y'all work "==" operator it volition furnish true, piece if y'all work "===" or strict equality operator, it volition furnish false. 


4) One to a greater extent than follow-up inquiry of == vs === operator is divergence betwixt != together with !== operator inward JavaScript. I mean value it's pretty slow to deduct that !== operator is strict non equality operator, which volition receive got type into consideration piece comparing 2 variables or 2 values inward JavaScript.

5) Last but non the to the lowest degree inquiry related to this JavaScript interview inquiry is, what hand off if y'all compare Nan alongside whatsoever number or Nan itself, using  === operator,  You should shout out back that NaN (Not a Number) is non equal to anything, including NaN.



In 1 of the recent JavaScript interview for a Java spider web evolution put Difference betwixt == together with ===  Equal Operator inward JavaScript


That's all virtually difference betwixt "==" together with "===" JavaScript operator, y'all should e'er work strict equality operator i.e. === together with avoid using == operator fifty-fifty if y'all demand type coercion, instead convert the type past times yourself to larn inward to a greater extent than readable. By the way, it's 1 of the interesting JavaScript interview Question, together with y'all tin await inward beginner marker JavaScript interviews, much to the same, where Java developers are expected to know virtually customer side tools e.g. HTML, CSS together with JavaScript. 


Further Learning
10 Java Programming Practice questions for Beginners
10 Frequently asked SQL Query Interview Questions
Difference betwixt hold off together with slumber inward Java
Difference betwixt primary together with unique telephone commutation inward SQL
Difference betwixt clustered together with non-clustered index inward SQL

Saturday, November 9, 2019

99 Angular Js Interview Questions For Javascript Spider Web Developers

The AngularJS is 1 of the pop JavaScript frameworks, I shout upward most pop afterwards jQuery, amongst the marrow finish of simplification. It allows edifice dynamic, unmarried page spider web apps (SPAs) using JavaScript together with supports the Model View Controller (MVC) programming structure. It has used widely together with fifty-fifty big companies similar Google, Virgin America, together with HBO are using Angular JS to create their site. The need for spider web developers is on all fourth dimension high together with at that topographic point is a huge need for developers who sympathize modern JavaScript frameworks e.g. Angular JS, jQuery, Facebook's React JS etc. The Angular JS is Open-source, front-end JavaScript framework which is developed past times Google, it mainly competes amongst Facebook's ReactJS framework.

AngularJS handles the heavy lifting of DOM manipulation together with AJAX mucilage that 1 time had to hold out coded from scratch together with encourages the developer to work modular edifice blocks of JavaScript code that tin flame hold out categorized together with are slow to test. You tin flame add together Angular JS to whatever HTML page using <script> tag.

If y'all are preparing for spider web developer interview together with Angular JS is mentioned inwards the Job description together with then y'all volition discovery the next listing of Angular JS interview questions useful. These are about of the ofttimes asked Angular JS Interview questions which bring been asked likewise many JavaScript developers together with it covers all of import topics of Angular JS. You tin flame work this listing to chop-chop banking concern check your grooming or to larn an thought of what to hold back on a JavaScript or Angular JS interview.



Angular JS Interview Questions

1) What is Angular JS framework? What are about of import features of Angular JS?

2) Why should y'all work Angular JS over ReactJS?

3) What is the deviation betwixt MVVM together with MVC together with MVP?

4) What is a unmarried page application? How tin flame 1 create a single-page application using AngularJS? Which provider is used to accomplish this objective?

5) How does Angular JS application bootstrap?

6) How to manual bootstrap AngualrJS?

7) AngularJS Initialization & rendering process?

8) What is the execution social club of Controller, Filters, Service, Factory, Config together with Run inwards Angular JS?

9) What is the deviation betwixt jqLite vs jQuery?

10) What are dissimilar types of binding inwards Angular JS?

11) What is two-way information binding inwards Angular JS?

12) What is ng-model directive inwards AngularJS?

13) Why ng-init is used inwards Angular?

14) Difference Between expression{{}} together with ng-bind inwards AngularJS?

15) What is the work of ng-repeat inwards Angular?

16) What if a duplicate chemical cistron inwards ng-repeat?

17) How to display unique chemical cistron inwards ng-repeat?


18) How to apply switch illustration inwards Angular JS?

19) What is the deviation betwixt service together with manufacturing works life inwards AngularJS?

20) Is service together with manufacturing works life singleton object?

21) How angular has to implement singleton designing inwards manufacturing works life together with service?

22) One scenario where services can't hold out used?

23) What is the important of # inwards the URL?

24) Explain UI Routing inwards AngularJS?

25) Abstract dry soil inwards UI routing?

26) What is the deviation betwixt ng routing vs UI routing inwards Angular?

27) Authorization inwards ng-routing?

28) What is the deviation betwixt range together with $scope?

29) Explain about benefits of controller As?

30) Explain Lazy loading of controllers?

31) How to banking concern check electrical flow running controller?

32) Communication betwixt 2 controllers

33) What are the ajax calls?

34) What are asynchronous means?

35) What are promises inwards Angular JS?

36) What are interceptors inwards Angular JS?

37) What is dependency injection? How to add together a dependency inwards angular?

38) What is digest cycle together with how y'all tin flame halt it?

39) How to banking concern check digest cycle is inwards progress?

40) What is $destroy?

41) What is ng-transclude?

42) How y'all tin flame all method of a controller inwards the directive ?

43) Different types of directives?

44) Controller vs link inwards the directive ?

45) Pre-link vs Post Link vs Compile functions?


46) What is the best way to manipulate DOM together with how tin flame nosotros do?

47) Directive trammel type?

48) Events inwards angular?

49) Restrict types inwards angular?

50) Custom exceptions inwards angular?

51) Filters inwards angular?

52) The custom filter inwards angularjs?

53) What are decorators?

54) Providers inwards angular?

55) Session management inwards angular?

56) Explain Authentication together with Authorization inwards angualrjs?

57) What is localization? How tin flame nosotros accomplish the localization?

58) What is local Storage?

59) What is session storage?

60) What is the deviation betwixt the local Storage together with Session Storage?

61) How to speed upward rendering UI?


62) The directory construction of angular js app?

63) Can y'all explicate about Best practices of Angular JS?

64) How to take ng-classes together with directive information from DOM?

65) What is angular 2?

66) What is the deviation betwixt Angular JS 1.x together with 2?

67) How Angular 2 is rendering DOM?

68) What is a grunt? Why nosotros work it?

69) Why nosotros work grunt other than minification?

70) What is gulp?

71) What are the novel things inwards available inwards html5?

72) What is Two way binding inwards Angular JS?

73) What is Ng-Bind inwards Angular JS?

74) What is One-way binding



75) Directives types

76) Difference betwixt $http vs $resource inwards Angular JS?

77) Explain Dependency injection In Angular JS

78) Explain Methods of $http service

79) How to initiate angular data

80) How create y'all unit of measurement exam an AngularJS filter?

81) What should hold out the maximum position out of concurrent "watches? How would y'all continue an oculus on that number?

82) How create y'all portion information betwixt controllers inwards Angular JS?

83) What is the deviation betwixt ng-show/ng-hide together with ng-if directives?

84) What is a digest cycle inwards AngularJS?

85) Should y'all work AngularJS together amongst jQuery?

 The AngularJS is 1 of the pop JavaScript frameworks 99 Angular JS Interview Questions for JavaScript Web Developers

86) How would y'all specify that a range variable should bring onetime binding only?

87) Explain how $scope.$apply() works?

88) Does angular.copy() method deep re-create or shallow copy?

89) When should y'all work an attribute versus an chemical cistron inwards Angular JS?

90) How create y'all reset a $timeout, $interval(), together with disable a $watch()?

91) Explain what is a $scope inwards AngularJS?

92) What is a singleton designing together with where nosotros tin flame discovery it inwards Angularjs?

93) What is an interceptor? What are mutual uses of it?

94) How does interpolation, e.g. "{{ someModel }}", genuinely work?

95) What is $rootScope together with how does it relate to $scope?
Answer: The $rootScope is the bring upward object of all $scope Angular objects created inwards a spider web page.

96) Explain the role of $routeProvider inwards AngularJS?

97) How create y'all enshroud an HTML chemical cistron via a push click inwards AngularJS?

98) How create y'all disable a push depending on a checkbox’s dry soil inwards Angular?

99) How would y'all implement application-wide exception treatment inwards your Angular app?


That's all close about of the frequently asked Angular JS Interview Questions. You mightiness bring seen many of these questions already on your interview, every bit it contains questions from both telephonic together with face-to-face interviews. This listing of questions is practiced to banking concern check your preparation. If y'all tin flame response all of these questions inwards special together with then y'all are practiced for the Angular JS project interview. You tin flame also work this listing to laid upward for the topics together with explore Angular JS inwards detail.

Reference
https://angularjs.org/
https://docs.angularjs.org/api
Angular five - The Complete Developer Guide
AngularJS inwards Action
Pro AngularJS past times Adma Freeman