Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Four-bit-adder/JavaScript/four-bit-adder-1.js
Normal file
14
Task/Four-bit-adder/JavaScript/four-bit-adder-1.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
function acceptedBinFormat(bin) {
|
||||
if (bin == 1 || bin === 0 || bin === '0')
|
||||
return true;
|
||||
else
|
||||
return bin;
|
||||
}
|
||||
|
||||
function arePseudoBin() {
|
||||
var args = [].slice.call(arguments), len = args.length;
|
||||
while(len--)
|
||||
if (acceptedBinFormat(args[len]) !== true)
|
||||
throw new Error('argument must be 0, \'0\', 1, or \'1\', argument ' + len + ' was ' + args[len]);
|
||||
return true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue