MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / invalidInput

Function invalidInput

assets/js/Code_Converter.js:77–94  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

75
76
77function invalidInput(input){ //Function to check for invalid inputs
78 let flag=true;
79 inputStr=input.toString();
80 if(input<0){
81 flag=false;
82 window.alert('Invalid input');
83 return flag;
84 }
85 for (let i=0 ;i<inputStr.length;i++){
86 ch=inputStr.charAt(i)
87 if(ch!='0' && ch!='1'){
88 flag=false;
89 window.alert('Invalid input');
90 return flag;
91 }
92 }
93 return flag;
94}

Callers 1

Code_Converter.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected