Enable contrast version

Tutor profile: Xavier F.

Inactive
Xavier F.
Mid Level Software Engineer
Tutor Satisfaction Guarantee

Questions

Subject: jQuery Programming

TutorMe
Question:

Write some jQuery code that will uncheck every checkbox with the name of "icecream", that is currently checked, whenever a form named "sandwiches" is submitted. Explain why your answer is correct.

Inactive
Xavier F.
Answer:

$("form[name='sandwiches']").on('submit',function(){ $("input[name='icecream']").filter(":checked").prop('checked',false) }) The above code use jQuery to create an event listener that will fire when the form named "sandwiches" is submitted. The code inside of the callback function will build a collection of jQuery objects that represent each checkbox on the DOM named icecream. Then by using the filter method and the pseudo selector ':checked', we remove the checkboxes that are not currently checked and then we use the prop method to uncheck each of these checkboxes that are currently checked off.

Subject: Javascript Programming

TutorMe
Question:

Using the below function to test whether the 3 provided arrays contain a number that is less than or equal to 23. Explain why your code returns the correct result for each test. function lessThanOrEqualTo23(elm, index, arr){ return elm <= 23 } const arr1 = [1,23,4,5] const arr2 = [18,58,9] const arr3 = [999999, 24,89]

Inactive
Xavier F.
Answer:

The code below makes use of the some() method of the array object to test each item in these arrays. The arr1 and arr2 will test true because they both contain numbers that are less than or equal to 23. While arr3 will test false since all of the numbers in this array are greater than 23. arr1.some(lessThanOrEqualTo23) // returns true arr2.some(lessThanOrEqualTo23) // returns true arr3.some(lessThanOrEqualTo23) // returns false

Subject: Computer Science (General)

TutorMe
Question:

Provide an example of one data structure that would be considered to be an ordered collection and one that would not be considered an ordered collection. Explain why both data structures are either an order or non ordered collection.

Inactive
Xavier F.
Answer:

An example of an ordered collection would be a linked list. The method of traversal within a linked list will always follow the same order, assuming no changes are made to structure, this shows that linked list is an ordered collection. Hashes are an example of a data structure that is not an ordered collection. Hashes are a collection of key/value pairs and retrieving the associated with one value does not require you to traverse through the entire structure until you reach key/value pair that you are looking for. With a hash, you are able to directly access the value that you need by simply providing the key to that value.

Contact tutor

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

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.