Hi I am new to javascript I am trying to create a function that I wanted to call if the string contains (-) will return a string value of "00" but if not will remain the same value. I will really appreciate any help or advice thank you.
example
val1= -01
expected output is =00
val2= 03
expected output:03
Code but not working
I used it like
myFunction(val1);
but this still return same value even string contains this -
function myFunction(myFunction) {
var n = myFunction.includes("-");
if (n =="true"){
return "00:00";
}else{
return myFunction;
}