Javascript weird dot operator syntax [duplicate]
问题 This question already has an answer here : What are the rules for invoking functions on number literals in JS? [duplicate] (1 answer) Closed 3 years ago . In Chrome console, also test in edge and firefox 5.toFixed(2); get Uncaught SyntaxError: Invalid or unexpected token in chrome. SyntaxError: identifier starts immediately after numeric literal in firefox. Expected ';' in edge. But code below 5.1.toFixed(2); (5).toFixed(2); is ok in all three browsers above. 回答1: This is because of the