Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Printer Errors

/*
In a factory a printer prints labels for boxes. For one kind of boxes 
the printer has to use colors which, for the sake of simplicity, 
are named with letters from a to m.
*/

const printerError = s => {
  let ratio = 0
  s.split("")
    .forEach(letter => (letter.charCodeAt(0) & 31) > 13 ? ratio+=1: null)
  return `${ratio}/${s.length}`
}

// With love @kouqhar
Comment

PREVIOUS NEXT
Code Example
Javascript :: assign single value to multiple variables in React js Or javacript 
Javascript :: dfs javascript 
Javascript :: input json decode 
Javascript :: Remove # id From URL When Clicked On Href Link 
Javascript :: queryselector undefined not working in react js 
Javascript :: code with mosh swipable react native not working 
Javascript :: phaser rotate matrix 180 
Javascript :: Class Which Can Create An Instance Of The Same Type 
Javascript :: function listview list grud abnAlhaj 
Javascript :: javascript cookies all together 
Javascript :: node-schedule cancel job 
Javascript :: difference between push and pop in javascript 
Javascript :: miragejs createServer timing 
Javascript :: js get first elements of array 
Javascript :: Viewing Your React App On Another Device 
Javascript :: react-native navigation homeStack 
Javascript :: 2--Calculate power function: Given two integers k and n, write a function to compute k^n.. 
Javascript :: jQuery mobile anchor link on the same page 
Javascript :: docker healthcheck express 
Javascript :: var logEvenNums = function(num) {}; 
Javascript :: JavaScript is synchronous by default 
Javascript :: Proper Way To Access Model(s) Data From Collection In Backbone 
Javascript :: how to add picture to picture video js in old library in js 
Javascript :: get user badge discordjs 
Javascript :: remove decimal places js 
Javascript :: ar.js 
Javascript :: math.ceil node js 
Javascript :: Remove uploaded file in jquery 
Javascript :: JavaScript (rhino 1.7.9) sample 
Javascript :: how to save data in javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =