'Clarifying A Javascript Function (or Method?) [duplicate]

I am new to JS, that is to say I've had about 2 and a half days of experience.

There is a piece of code I don't quite understand and would appreciate a clarification.

confirmPassword.oninput = () => checkPassword(confirmPassword.value);

I can make sense of what is happening here, kind of, but not entirely.

The = () => confuses me a bit.



Solution 1:[1]

It's doing this:

confirmPassword.oninput = function() {
    checkPassword(confirmPassword.value);
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 John Doherty