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? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Robert Merrill
6,215 Pointsformatting questions on the forum
Hi,
I'm trying to ask a question from class that I need help with. When I copy it onto this page it looks great. When it loads the format looks off. Any suggestions on the best way to paste something from my text editor into this forum?
See example below:
// Implement the following functions. Write at least 2
// assertions for each one (the assertions are how you
// will test your code)
//*********************************************************
function lastLetterSort(stringArray) {
function byLastLetter(a, b) {
//TODO: implement me. sort the strings in alphabetical
// order using their last letter
}
stringArray.sort(byLastLetter);
}
function sumArray(numberArray) {
var sum = 0;
// TODO: implement me using forEach
return sum;
}
function sumSort(arrayOfArrays) {
arrayOfArrays.sort(function(item) {
// TODO: implement me using sumArray
// order the arrays based on the sum of the numbers
// inside each array
});
}
Robert Merrill
6,215 PointsThanks, Jacob!
Jacob Mishkin
23,118 Pointslet me know when you reformatted your prior question, and I will be happy to help if I can.
Robert Merrill
6,215 PointsJacob, Yes, I reposted a few minutes ago under "Sorting Question". Thanks!
1 Answer
Chris Freeman
Treehouse Moderator 68,468 PointsI updated the format of your question by adding triple-backticks: ```javascript before and ``` after your code block.
Jacob Mishkin
23,118 PointsJacob Mishkin
23,118 PointsRobert,
I didn't know that you didn't know how to do this. Sorry about earlier.
when posting, just above the post comment button there is a link called Markdown Cheatsheet click that and it will tell you how to post code into the comment field.