Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions likeAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function expandAll(){
z[0].click();
ctr++;
alert(ctr);
if (ctr<=5){ loop();}
if (ctr<=5){ loop() ;}
}

function loop(){
Expand All @@ -16,9 +16,9 @@ function loop(){
expandAll();

var x = document.getElementsByClassName('like_link stat_elem as_link');
for(var i = 0; i < x.length; ++i) {
if(x[i].name=='like') {x[i].click();}
for(var i = 0; i < x.length; i++) {
if(x[i].name='like') {x[i].click()}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditional statement in the for loop was using an assignment operator instead of a comparison operator. This has been corrected to use the strict equality operator for comparison.

Suggested change
if(x[i].name='like') {x[i].click()}
if(x[i].name === 'like') {x[i].click()}


};
alert("done");
void(0);
void(1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing unnecessary use of the void operator to improve code readability.

Suggested change
void(1);
alert("done");