Sorting Firebase data | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Sorting Firebase data

I cant sort the data that I have imported to my code from the firebase.... please how will I sort the players and their xp correctly? https://code.sololearn.com/Wy7lZ5e0z9v7/?ref=app

4th Nov 2020, 7:20 AM
LIONEL
LIONEL - avatar
4 Answers
+ 4
You are trying to pass a CSS selector to the getElementByTagName() method. You should just pass the tag name(table) or use the querySelectorAll() method to get the collection of tables. At line 16 change let table = document.getElementsByTagName("#modal table"); to let table = document.querySelectorAll("#modal table"); BTW I notice a few other errors. At line 23 change tr to "tr" At line 34 change Obj[`${newObj[i]}`] to obj[`${newObj[i]}`]
5th Nov 2020, 1:24 AM
ODLNT
ODLNT - avatar
+ 4
ODLNT yeah!!!!!๐Ÿ˜‚
6th Nov 2020, 5:44 AM
LIONEL
LIONEL - avatar
+ 2
ODLNT thank you Soo much!!!!!!!!!!!!!! ๐Ÿ˜๐Ÿ˜๐Ÿ˜๐Ÿ˜๐Ÿ˜๐Ÿ˜…๐Ÿ˜… I did not even notice those silly bugs ๐Ÿ˜‚๐Ÿ˜‚
5th Nov 2020, 8:56 AM
LIONEL
LIONEL - avatar
+ 2
Lฬทยฃยฃ YฬทOฬทOฬท Nฬทโˆ†LฬทEฬท, you're welecome. It is the silly bugs that bite us on the butt most of the time.๐Ÿž๐Ÿฆ‚๐ŸฆŸ๐Ÿœ๐Ÿ‘Œ๐Ÿฝ๐Ÿ‘๐Ÿฝ
5th Nov 2020, 11:31 AM
ODLNT
ODLNT - avatar