Enable contrast version

Tutor profile: Debasish M.

Inactive
Debasish M.
Senior Developer at Verifone
Tutor Satisfaction Guarantee

Questions

Subject: Web Development

TutorMe
Question:

What is Routing Guard in Angular?

Inactive
Debasish M.
Answer:

Angular’s route guards are interfaces which can tell the router whether or not it should allow navigation to a requested route. They make this decision by looking for a true or false return value from a class which implements the given guard interface.

Subject: Javascript Programming

TutorMe
Question:

What is the output of below code snippet? (function(){ var a = b = 3; })(); console.log("a defined? " + (typeof a !== 'undefined')); console.log("b defined? " + (typeof b !== 'undefined'));

Inactive
Debasish M.
Answer:

Since both a and b are defined within the enclosing scope of the function, and since the line they are on begins with the var keyword, most JavaScript developers would expect typeof a and typeof b to both be undefined in the above example. However, that is not the case. The issue here is that most developers incorrectly understand the statement var a = b = 3; to be shorth and for: var b = 3; var a = b; But in fact, var a = b = 3; is actually shorthand for: b = 3; var a = b; As a result (if you are not using strict mode), the output of the code snippet would be: a defined? false b defined? true But how can b be defined outside of the scope of the enclosing function? Well, since the statement var a = b = 3; is shorthand for the statements b = 3; and var a = b;, b ends up being a global variable (since it is not preceded by the var keyword) and is therefore still in scope even outside of the enclosing function. Note that, in strict mode (i.e., with use strict), the statement var a = b = 3; will generate a runtime error of ReferenceError: b is not defined, thereby avoiding any headfakes/bugs that might othewise result. (Yet another prime example of why you should use use strict as a matter of course in your code!)

Subject: Java Programming

TutorMe
Question:

What will the below line return? (5*0.1 == 0.5)

Inactive
Debasish M.
Answer:

The answer is false.Because floating point numbers cannot be exactly represented in java.So 5*0.1 is not same as 0.5.

Contact tutor

Send a message explaining your
needs and Debasish will reply soon.
Contact Debasish

Request lesson

Ready now? Request a lesson.
Start Lesson

FAQs

What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Lesson" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.
BEST IN CLASS SINCE 2015
TutorMe homepage
Made in California by Zovio
© 2020 TutorMe, LLC
High Contrast Mode
On
Off