One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
getLoginAPI = () => { | |
let details = { | |
'username': 'username', | |
'password': 'demo' | |
}; | |
let formBody = []; | |
for (let property in details) { | |
let encodedKey = encodeURIComponent(property); |
function getLastEan13Digit(ean) { | |
if (!ean || ean.length !== 12) throw new Error('Invalid EAN 13, should have 12 digits') | |
const multiply = [1, 3] | |
let total = 0 | |
ean.split('').forEach((letter, index) => { | |
total += parseInt(letter, 10) * multiply[index % 2] | |
}) |