Exact meaning of Function literal in JavaScript
问题 In JavaScript there are both Object literals and function literals. Object literal: myObject = {myprop:"myValue"} Function literal: myFunction = function() { alert("hello world"); } What is the significance of the word literal? Can we say Java has method literals? public void myMethod() { System.out.println("are my literal"); } 回答1: A function literal is just an expression that defines an unnamed function. The syntax for a function literal is much like that of the function statement, except