JSFiddle - React, Tailwind, and code Playground
HTML
<input id="data" value="Hello word">
JavaScript
var input = document.getElementById('data');
//polymorphism(input);
//polymorphism('Hello word 2');
//polymorphism('hello word 3', 5);
in();
in('Hello');
funcion in()
{ alert('bl'); }
funcion in(com)
{ alert(com); }
function polymorphism(arg,arg1){
var string = null;
var sqr = 0;
if(typeof arg === 'string'){
string = 'arg type String: \n'+arg;
}else if (arg.tagName && arg.tagName === 'INPUT'){
string = 'arg type Input: \n'+arg.value;
}
if(arg1 && typeof arg1 === 'number'){
sqr = arg1*arg1;
alert(string + ' and sqr = '+sqr);
}else {
alert(string);
}
}