Smallest Even Multiple in JS easy way
Intuition\n1. Need to find the smallest even multiple of the given number n.\n2. If n is already an even number, then n itself is the smallest even multiple.\n3
# Intuition\n1. Need to find the smallest even multiple of the given number n.\n2. If n is already an even number, then n itself is the smallest even multiple.\n3. Otherwise, we need to multiply n by 2 to get the smallest even multiple.\n\n# Approach\nFirstly, we need to find is there a reminder when n is divided by 2.\nIf the reminder is equal to 1, the we need to return n * 2.\nIf the reminder is 0, then simply return the n.\n\n# Complexity\nComplexity | Details\n--- | ---\nJavaScript | 63 ms\n\n\n# Code\n```\n/**\n * @param {number} n\n * @return {number}\n */\nvar smallestEvenMultiple = function(n) {\n\nvar reminder =  n % 2\n\nif (reminder == 1) {\n    return n * 2\n} else if (reminder == 0) {\n    return n\n}\n\n};\n\n```
['JavaScript']