To be more specific, this particular code block doesn’t work because there is a syntax error - an extra } at the end. This is reported in the browser’s dev tools console:
}