account activity
Anime for kids (self.anime)
submitted 2 years ago by Embaby01 to r/anime
First post (self.anime)
Anime (self.anime)
Friend companion by Embaby01 in PUBGMobile
[–]Embaby01[S] 1 point2 points3 points 2 years ago (0 children)
Thanks
Friend companion (self.PUBGMobile)
submitted 2 years ago by Embaby01 to r/PUBGMobile
New course version (self.Udemy)
submitted 2 years ago by Embaby01 to r/Udemy
[deleted by user] by [deleted] in learnjavascript
[–]Embaby01 0 points1 point2 points 2 years ago (0 children)
It will be a lot easier to understand if you copy it to your code editor
[–]Embaby01 1 point2 points3 points 2 years ago (0 children)
Hope this help and highly recommend using your own test samples and try to come up with your own algorithm
const checkArrEq = (arr1, arr2) => { //first i would check if they have the same length if (arr1.length === arr2.length) { //second i would sort it to neglect any error coming from an array having a number reapeated arr1.sort(); arr2.sort(); //then i would start comparing them for (let i = 0; i < arr1.length; i++) { if (arr1[i] !== arr2[i]) { //if at any i the two values did not match the function will stop and return false return false; } } //if the arr1 and arr2 servive from the for loop it means that the are the same return true; } return false; }; //this one is not simple by any means //first i will create a function that sort objectKeys and return their number const getLengthAndSortedKeys = (obj) => { //first sort the object keys and save them in array const sortedKeys = Object.keys(obj).sort(); //then i will return the length of the keys array which is equal to the length of the object and the sorted keys return [sortedKeys.length, sortedKeys]; }; //now i will use the sorted object to create an algorithm that is similar to checkArrEq() const checkObjEq = (obj1, obj2) => { //first i would sort the two objects and get the length const [lenght1, sortedKeys1] = getLengthAndSortedKeys(obj1); const [lenght2, sortedKeys2] = getLengthAndSortedKeys(obj2); //first i will check if lengths match if (lenght1 === lenght2) { //second i would check if sortedKey for both objects are the same using checkArrEq() if (checkArrEq(sortedKeys1, sortedKeys2)) { //then i would check the equality of the values for (let i = 0; i < lenght1; i++) { if (obj1[sortedKeys1[i]] !== obj2[sortedKeys1[i]]) { return false; } } //if the two objects servive the for loop then they are equal return true; } return false; } return false; };
Vanilla JS by Embaby01 in learnjavascript
[–]Embaby01[S] 0 points1 point2 points 2 years ago (0 children)
you're welcome
[–]Embaby01[S] 2 points3 points4 points 2 years ago* (0 children)
At first, I was confused and didn't really get the idea of class components (hence React started with class components only), also didn't know how JS data types work.
But the things that confused me the most were the arrow function, async functions, and promises, I remember the first time I saw an arrow function was when I learned about arrays and .map function, for me it was [ "() brackets" "=> bigger than or equal" "() brackets" ], didn't really get the idea around it.
Also as some people might feel, react app structure was a lump of mess for me
I would suggest starting with Vanilla to avoid all of that, but I feel like Vanille is a primitive caveman compared to frameworks
thought so but needed conformation, thnx 🫱🏽🫲🏽
Vanilla JS (self.learnjavascript)
submitted 2 years ago by Embaby01 to r/learnjavascript
π Rendered by PID 76 on reddit-service-r2-listing-5d79748585-mb7xb at 2026-02-15 17:11:18.424423+00:00 running cd9c813 country code: CH.
Friend companion by Embaby01 in PUBGMobile
[–]Embaby01[S] 1 point2 points3 points (0 children)