The JavaScript language achieves the following effects: 3. grams. flour, sunflour
The JavaScript language achieves the following results: 3. grams. flour
See Javascript: The Good Parts, page 1
The Code is as follows:
<Html>
<Body>
<Script type = "text/javascript">
// Copied from page 33 of Javascript: The Good Parts
Function. prototype. method = function (name, func)
{
This. prototype [name] = func;
Return this;
}
Number. method ('chi ', function (){
Return this * 0.333;
});
Document. writeln (3). chi ());
Document. writeln ("<br> ");
Document. writeln (3 + 1). chi ());
Document. writeln ("<br> ");
Document. writeln (3.2.chi ());
Document. writeln ("<br> ");
Document. writeln (3.0.chi ());
// Document. writeln (3.chi ());
// SyntaxError: identifier starts immediately after numeric literal
</Script>
</Body>
</Html>
The running result is as follows:
0.9990000000000001
1.332
1.0656
0.9990000000000001
Work hard and enjoy yourself.