const cutComment = string => {
let onlyComment = string.indexOf('//');
if (string.indexOf('/') < 1) {
return null;
}
return string.substr(onlyComment+2).trim();
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter