In the second code sample, there is an extra bracket on the end of an if statement.
https://gyazo.com/2d74e5ad8d4e2d35fe7ff8b9631ae7b6
The final bracket is not valid.
In the second code sample, there is an extra bracket on the end of an if statement.
https://gyazo.com/2d74e5ad8d4e2d35fe7ff8b9631ae7b6
The final bracket is not valid.