Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

School paperwork

// Your classmates asked you to copy some paperwork for them. You know that there are 'n' classmates and the paperwork has 'm' pages.
// Your task is to calculate how many blank pages do you need. If n < 0 or m < 0 return 0.

/* Example:
	n= 5, m=5: 25
	n=-5, m=5:  0
*/

const paperwork = (n, m) => (m < 0 || n < 0) ? 0 : m * n

// With love @kouqhar
Comment

PREVIOUS NEXT
Code Example
Javascript :: get lat long react native 
Javascript :: add multiple phone using js 
Javascript :: complex expression in programming 
Javascript :: apply multiple style objects in react js 
Javascript :: toast plugin 
Javascript :: remove text and keep div inside a div jquery 2 
Javascript :: when end sound show alert 
Javascript :: Expresiones regulares para diferentes tipos de campos de formularios 
Javascript :: nodejs stream pipeline with custom transform 
Javascript :: hot reload nestjs 
Javascript :: how to target a hidden html element by js 
Javascript :: Set A Function For An Element 
Javascript :: usestate access previous state 
Javascript :: how to call ajax javascript 
Javascript :: js promise example 
Javascript :: loop on each character js 
Javascript :: javascript interview questions 
Javascript :: javascript array map 
Javascript :: anti aliasing 
Javascript :: Update an object as state with React hooks 
Javascript :: python json replace string 
Javascript :: swagger ui express 
Javascript :: react-hook-form-input npm 
Javascript :: delegate in javascript 
Javascript :: jetty 
Javascript :: react native dynamic style 
Javascript :: react -native-config 
Javascript :: how to add space between words in javascript 
Javascript :: call node.js file electron 
Javascript :: jconfirm button 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =