Enable contrast version

Tutor profile: Jace G.

Inactive
Jace G.
Software Developer at BYU
Tutor Satisfaction Guarantee

Questions

Subject: Web Development

TutorMe
Question:

How does Firebase structure your databse?

Inactive
Jace G.
Answer:

Firebase structures your database by using a JSON object. Allowing for faster speed and easy to navigate information.

Subject: Javascript Programming

TutorMe
Question:

var one = ['a', 'a', 'b', 'c', 'd'] var two = ['b', 'c' , 'd'] function test(one, two){ var three = {}; var last = []; var i = 0; for (i; i < one.length; i++){ three[one[i]] = true; } Object.keys(three).forEach(function(key) { one.push(key); }); for(var i in two) { if(one.indexOf(two[i]) === -1) last.push(two[i]); } for (i in one) { if(two.indexOf(one[i]) === -1) last.push(one[i]); } for (i in last){ if(last.indexOf(last[i] === i)) last.pop(i); } return last } var answer = test(one, two); If you were to console.log answer what would the console display?

Inactive
Jace G.
Answer:

When looking through the code, you start with two arrays, 'one' and 'two'. Then you have a function defined, 'test' that accepts two variables as inputs. After the function you have a variable, 'answer' that is set to the value of what the function test returns. As array ;one' and 'two' are passed to the function, they are manipulated in the following way. 1) An object named 'three' is created 2) An array named 'last' is created 3) A variable named i is created and set to 0 4) The object 'three' is populated with a for loop, where the values from array 'one' are used as the keys in the object. This creates an object with only 4 keys, since keys are unique, and you cannot have two keys with a value of 'a'. 5) Next there is a for loop that iterates through each of the 4 keys and appends them to array 'one' 6) Next there is a for loop that iterates through each item in array 'two' to check and see if that value is in array one. If it is in array 'two', and in array 'one', it is ignored, if it is only in array 'two' and not in array 'one' then it adds it to the previously created array 'last' 7) This does the same thing as number six except that it iterates through array 'one' first and checks the values against array 'two'. 8) The last for loop in the function iterates through the array 'last' and removes any items in the array that are the same value 9) the function then returns the array, 'last' The console would display ['a']

Subject: Basic Math

TutorMe
Question:

Susan has flips a penny 3 times. What is the probability that she gets heads all 3 times?

Inactive
Jace G.
Answer:

1) This question is asking what the probability is that she will get a heads on the coin each time she flips it. 2) We know that a penny has 2 sides, so that means that there is a 50% chance she gets a heads on the first flip or a 1/2. 3) We also know that each time she flips a coin we will have a 50% chance of getting a heads or 1/2 4) since she flips the coin three times we will multiply those odds together so... =50% * 50% * 50% or =1/2 * 1/2 * 1/2 5) When we multiply those together we get the answer 12.5% or 1/8.

Contact tutor

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

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.