r/shittyprogramming • • Mar 26 '19

Abusing JavaScript's Syntax? Yay!

Post image
208 Upvotes

15 comments sorted by

View all comments

Show parent comment

5

u/AyrA_ch Mar 26 '19

But then you could no longer do the method chaining. This only works because all functions return the next function you need.

1

u/YRYGAV Mar 27 '19

Wouldn't semicolon insertion fix the issue anyways?

1

u/AyrA_ch Mar 27 '19

semicolon insertion is the problem which makes the lines look like individual instructions rather than a chain of them.

1

u/sim642 Mar 27 '19

There's no chaining then. Just multiple lines of code calling different functions, the most usual kind of code.