Enable contrast version

# Tutor profile: Gray O.

Inactive
Gray O.
Math, Science, Computer and Art Geek and Tutor
Tutor Satisfaction Guarantee

## Questions

### Subject:Javascript Programming

TutorMe
Question:

Consider the following code: $(\texttt{ (function() { var a = b = 10; })(); console.log(a); console.log(b); }$) What will be output to the console?

Inactive
Gray O.

The first thing we notice in this question is that we have a function literal that is being called immediately and then two $${\tt console.log}$$ statements that output the value of variables $$a$$ and $$b$$. The important thing to understand here is that the IIFE will interpret the line $${\tt var a = b = 10;}$$ as two separate assignments. The first will assign a local variable $$a$$, to the value of $$b$$. However, in order to get the value of $$b$$, it must first assign $$b$$ to be a global variable with the value 10. $$b$$ is a global variable because it does not have the keyword $${\tt var}$$ in front of it. Therefore, the console will output $(\texttt{ undefined 10 })$ $$a$$ is a local variable to the function literal, so it will not be defined in the global scope. $$b$$, on the other hand, is declared as a global variable, and so its value will still be 10 outside of the function.

### Subject:Trigonometry

TutorMe
Question:

Two airplanes take off at the same time from the same airport. One is traveling at 350mph and the other is traveling at 575mph. How far apart are they from each other after 1 hour and 40 minutes if there is an angle of 30 degrees between their directions of flight?

Inactive
Gray O.

## Contact tutor

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

## 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.