Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Codewars JS Beginner Series #3 Sum of Numbers

const getSum = (a, b) => {
    let min = Math.min(a, b),
        max = Math.max(a, b);
    return (max - min + 1) * (min + max) / 2;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: js change opacity 
Javascript :: event listener mousemove 
Javascript :: wp_enqueue_script bootstrap 
Javascript :: jquery onchange input value 
Javascript :: js search json 
Javascript :: jquery 1 second after page load 
Javascript :: moment format date dd/mm/yyyy 
Javascript :: javascript detect mobile device 
Javascript :: javascript base64 encode string 
Javascript :: lerp javascript 
Javascript :: reactnavigation 5 hide header 
Javascript :: step over vs step into vs step out 
Javascript :: how to add double click event in javascript 
Javascript :: Get random name from an array in javascript 
Javascript :: show and hide div tag based on checkbox selection using jquery 
Javascript :: filter array of objects by another array of objects 
Javascript :: javascript add string inside foreach 
Javascript :: javascript text to clipboard 
Javascript :: javascript clear style inline property 
Javascript :: radio button checked event jquery 
Javascript :: print to console without newline nodejs 
Javascript :: js number to hex 
Javascript :: yarn create strapi-app 
Javascript :: console.log object at current state 
Javascript :: performance.now nodejs example 
Javascript :: aabb javascript 
Javascript :: express check if object is empty 
Javascript :: stop propagation event 
Javascript :: js colored console log 
Javascript :: get number of days in a month javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =