Created
March 22, 2020 02:33
-
-
Save krowter/55bb231f20e3cde7e7bce2ab70570b00 to your computer and use it in GitHub Desktop.
Arrow function vs Regular function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//penulisan dengan arrow function | |
(number, index) => { | |
if(number === numberToMove) { | |
input.splice(index, 1) | |
input.push(number) | |
} | |
} | |
//fungsi di atas ekuivalen dengan fungsi di bawah | |
//penulisan dengan regular function | |
function(number, index) { | |
if(number === numberToMove) { | |
input.splice(index, 1) | |
input.push(number) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment