Articles → JAVASCRIPT → Arrow Function In Javascript
Arrow Function In Javascript
Purpose
Example
<html><head><title></title><script>
/*Traditional way of writing function*/
myMessageOne = function ShowMessageOne(message) {
alert(message);
}
/*Arrow function with no parameters*/
myMessageTwo = () => {
alert("Arrow function demo");
}
/*Arrow function with parameters*/
myMessageThree = (message) => {
alert(message);
}
myMessageOne("Hi");
myMessageTwo();
myMessageThree("Arrow function demo 2");
</script></head><body></body></html>
Output