Enable contrast version

Tutor profile: Matt D.

Inactive
Matt D.
Caring Tutor
Tutor Satisfaction Guarantee

Questions

Subject: Web Development

TutorMe
Question:

What type of error might you see if you make a javascript request to a remote server other than the server from which the javascript code was served? Where does this error originate? From your code, the browser or your server?

Inactive
Matt D.
Answer:

You will likely see a CORS type error in this case. CORS stands for Cross Origin Resource Sharing. Making a request to a remote server is an indication of a potential security threat, such as a cross site request forgery, and the most browsers will not allow it.

Subject: Javascript Programming

TutorMe
Question:

What will this code do? for (var i = 0; i < 3; i++) { setTimeout(function() { alert(i); }, 1000 * i); } Why?

Inactive
Matt D.
Answer:

This will output the number "3" after 1 second, again after 2 seconds and again after 3 seconds. The reason is because of javascript closures. The inside function has lasting access to the variables of the enclosing function. In this case the variable i is set to 3 at the end of the loop, and this is the value of i when the setTimeout executes after a delay.

Subject: Software Engineering

TutorMe
Question:

What do the concepts of loose coupling and high cohesion mean?

Inactive
Matt D.
Answer:

Loose coupling is a principle in software engineering that points to the idea of keeping modules or portions of code independent of each other as much as possible so that changes to one module don't have too much of an impact on other modules that depending on it. High cohesion means that modules should have a single well-defined purpose, and not try to do too much at once. This makes code easier to maintain, and makes it easier to track down bugs.

Contact tutor

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

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