Quote:
Originally Posted by Frenzie
Not only is it not a syntax error, but removing trailing commas is bad practice.
|
Code:
return {
["cre_header_status_font_size"] = 40,
["copt_line_spacing"] = 110,
["disable_double_tap"] = true,
["copt_render_dpi"] = 300,
["start_with"] = "last",
["disable_kobolight"] = true,
["cre_header_status_font_size"] = 30,
["full_refresh_count"] = 12,
["larger_tap_area_to_follow_links"] = true,
["copt_b_page_margin"] = 10,
}
If it was not obvious I was referring to that single comma marked in red color.
So, are you telling me that Lua (or whatever language's 'data structure' / collection/list/array type that code snippet represents) is different than almost any other language under the Sun (even CSS properties list! respect those same conventions) where any type of "enumerating stuff" shouldn't end with a comma as that results in syntax error or parsing error?
Even when returning multiple things as separate objects you wouldn't end that statement with a comma.