Entering let x = flow.get('var_push') means the editor has no idea what x is.
Lets say for arguments sake x is now an instance of MyLegacyString and MyLegacyStringhas a prototype function named substr - this is perfectly valid as far as the editor knows.
Entering let x = "06:10" makes the editor realise that x is a native string. And as @dceejay points out...
String.prototype.substr(…) is not strictly deprecated (as in “removed from the Web standards”), it is considered a legacy function and should be avoided when possible. It is not part of the core JavaScript language and may be removed in the future. If at all possible, use the substring() method instead
In short, use substring if you care - or use substr if you dont.
There is no problem the editor is warning that substr is depreciated and would be best to use substring or slice. The warning is there so you know that substr is depreciated. The substr will still work as it is there for legacy code, so older scripts still work. You can move to substring or slice, as one day substr may stop working, if removed from JS as a legacy function/method. String.prototype.substr() - JavaScript | MDN for more info