Return Value (Example) | Treehouse Community
Dec 15, 2014 ... DOCTYPE html> <html lang="en"> <head> <title>JavaScript Foundations: Functions</title> <style> html { background: #FAFAFA; font-family: ...
Dec 15, 2014 ... DOCTYPE html> <html lang="en"> <head> <title>JavaScript Foundations: Functions</title> <style> html { background: #FAFAFA; font-family: ...
MDN – find() The find() method returns the first element in the provided array that satisfies the provided testing function. If no values satisfy the testing function, undefined is returned. According to the documentation, it looks like find() returns the first instance of our logic that is truthy.
Task: Around line 17, create a function named 'arrayCounter' that takes in a parameter which is an array. The function must return the length of an array passed in or 0 if a 'string', 'number' or 'undefined' value is passed in.
Welcome to the Treehouse Community. Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project?This is in regards to the code challenge in the "Return Values" section of the JavaScript lessons.
Create a method called 'requiredValues' that returns an array of all the values of inputs with the class of 'required'. My incorrect answer: function requiredValues(){ $(".required").each(function(){ new Array().push($(this).val()); }); return new Array(); } Please give me the actual answer.