Guest User

Untitled

a guest
Jan 16th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. let not_favored = [...document.querySelectorAll(".not-favored")];
  2.  
  3. for(let index =0; index<not_favored.length;index++ ){
  4.  
  5.  
  6. // Allow type cast instead of doing it manually, recall '==' allows type casting while '===' doesn't
  7. console.log("the index of the children is " + not_favored[index].children[0].children[0].children[0].children[0].id + " and the index of the local_storage is " + localStorage.key(index+"") )
  8. if(not_favored[index].children[0].children[0].children[0].children[0].id == localStorage.key(index +"") && localStorage.key(index+"") !== null){
  9. console.log("how many times this occurs? Does it even work or compare key, which is the ID with the right index of that ID?")
  10. not_favored[index] = localStorage.getItem(localStorage.key(index.toString()))
  11.  
  12. }
  13. else{
  14. not_favored[index] = not_favored[index].outerHTML;
  15. }
  16.  
  17. the index of the children is 0 and the index of the local_storage is 2
  18. the index of the children is 1 and the index of the local_storage is 3
  19. the index of the children is 2 and the index of the local_storage is null
  20. the index of the children is 3 and the index of the local_storage is null
  21. the index of the children is 4 and the index of the local_storage is null
  22.  
  23. the index of the children is 0 and the index of the local_storage is null
  24. the index of the children is 1 and the index of the local_storage is null
  25. the index of the children is 2 and the index of the local_storage is 2
  26. the index of the children is 3 and the index of the local_storage is 3
  27. the index of the children is 4 and the index of the local_storage is null
Add Comment
Please, Sign In to add comment