fix: use arrow function syntax (#37818)
This commit is contained in:
		
				
					committed by
					
						 Manish Giri
						Manish Giri
					
				
			
			
				
	
			
			
			
						parent
						
							0c22313760
						
					
				
				
					commit
					dc1b59070e
				
			| @@ -11,9 +11,8 @@ In order to help us create more flexible functions, ES6 introduces <dfn>default | |||||||
| Check out this code: | Check out this code: | ||||||
|  |  | ||||||
| ```js | ```js | ||||||
| function greeting(name = "Anonymous") { | const greeting = (name = "Anonymous") => "Hello " + name; | ||||||
|   return "Hello " + name; |  | ||||||
| } |  | ||||||
| console.log(greeting("John")); // Hello John | console.log(greeting("John")); // Hello John | ||||||
| console.log(greeting()); // Hello Anonymous | console.log(greeting()); // Hello Anonymous | ||||||
| ``` | ``` | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user