on this page: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat
The compatibility claims that this function is not supported on Android, but it seems to work for me on embedded Android 7 WebView.
I would expect but cannot tell for sure without further investigation and testing whether or not the same would be the case in the Android browser app.
I would love to investigate this further and make a contribution at some point, unfortunately fighting some urgent deadlines right now.
I would also favor investigating and testing some of the other String.prototype functions.
Thank you for reporting this.
Looking at the data for repeat, it's rather old and probably wasn't checked when it was first introduced.
I tested the interactive example for repeat() in SauceLabs in the desktop Chrome and it's unsupported until Chrome 41. Given what we know about the relationship between these browser, I would expect the data to be the same for Chrome, Chrome for Android, and WebView: "version added": "41".
I'd welcome a PR updating this, from you or another contributor. I've marked this as "good first issue" since it's a pretty straight forward fix to String.json.
Fixed by @joneskj55 in https://github.com/mdn/browser-compat-data/pull/7488 :tada:
Most helpful comment
Thank you for reporting this.
Looking at the data for
repeat, it's rather old and probably wasn't checked when it was first introduced.I tested the interactive example for
repeat()in SauceLabs in the desktop Chrome and it's unsupported until Chrome 41. Given what we know about the relationship between these browser, I would expect the data to be the same for Chrome, Chrome for Android, and WebView:"version added": "41".I'd welcome a PR updating this, from you or another contributor. I've marked this as "good first issue" since it's a pretty straight forward fix to
String.json.