Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

codewars js Number of People in the Bus

var number = function (busStops) {
    let totalPpl = 0
    for (let i = 0; i < busStops.length; i++) {
        let currStop = busStops[i]
        let getOn = currStop[0]
        let getOff = currStop[1]
        totalPpl += getOn;
        totalPpl -= getOff;
    }
    return totalPpl;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: object notation and array notation dynamic class binding vuejs 
Javascript :: How to update url using backbone 
Javascript :: run a nodejs file infinite loop 
Javascript :: drm react native 
Javascript :: react making post request 
Javascript :: create element javascript with class 
Javascript :: convert hsl to hex code javascript 
Javascript :: react native rename package name 
Javascript :: remove file from input type file jquery 
Javascript :: jquery get select option attribute 
Javascript :: angular 10 set error on form controle 
Javascript :: create array initialize size javascript 
Javascript :: Invariant Violation: requireNativeComponent: "RNSScreen" was not found in the UIManager 
Javascript :: javascript find diff in nested objects node js 
Javascript :: angular datepicker sending value one day less than 
Javascript :: how to delete all slash command discord.js 
Javascript :: jquery create a button 
Javascript :: node js try catch 
Javascript :: how to check if a folder exists in node js 
Javascript :: how to get session javascript ws3schools 
Javascript :: query params in next js 
Javascript :: negative number error handling in javascript 
Javascript :: run js function after some sec 
Javascript :: get element size javascript 
Javascript :: how to print a number with commas as thousands separators in javascript 
Javascript :: node mon in loopback 
Javascript :: minecraft infinite snapshot dimensions 
Javascript :: js detect scroll 
Javascript :: lodash delete object property 
Javascript :: most 5 spoken language in countries array in js 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =