It looks like unicode characters cannot be used in code-editor, for instance this code does not work:
View1.difficulty = "★".repeat(5)
Do you plan to allow unicode characters in code?
Instead of the 'X' in below code, one then could use a unicode symbol, like a star, etc:
// retrieve difficulty level from database var n = rs.difficulty; // show symbol n times View1.difficulty = "X".repeat(n)