Its not effective vs any scraping; how do you imagine scraping works? In the most basic case, a program makes a HTTP request, gets the source of your page, and processes it via a HTML parser.
In some cases, the same HTML source will be run through a headless browser to parse it, in which case javascript trickery can't protect it either.
The basic answer is: if an end user can see it in a browser, you can't hide it from a scraper.