Posts by Roque Viana • 9 points
2 posts
-
-1
votes4
answers8429
viewsA: How to use template string in Javascript?
Vanilla JS: String.prototype.format = function (args) { var text = this for(var attr in args){ text = text.split('${' + attr + '}').join(args[attr]); } return text }; json = {'who':'Gendry',…
-
-1
votes9
answers17879
viewsA: How to identify if a string is a palindrome?
I challenge you to find a palindrome or a palindrome not detectable by this algorithm! We need to normalize the text before comparing to its inverse, otherwise an accent can generate a false…