Skip to content

Instantly share code, notes, and snippets.

@gustavom
Created May 25, 2017 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gustavom/538584cf1df54f8ad5ec52100adbee38 to your computer and use it in GitHub Desktop.
Save gustavom/538584cf1df54f8ad5ec52100adbee38 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/mopewawofo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
const word = 'Palavra'
function removeLastChar (word) {
console.log(word)
if (word.length === 0) {
return
}
setTimeout(() => {
removeLastChar(word.replace(/\w$/, ''))
}, 1000)
}
removeLastChar(word)
</script>
<script id="jsbin-source-javascript" type="text/javascript">const word = 'Palavra'
function removeLastChar (word) {
console.log(word)
if (word.length === 0) {
return
}
setTimeout(() => {
removeLastChar(word.replace(/\w$/, ''))
}, 1000)
}
removeLastChar(word)</script></body>
</html>
const word = 'Palavra'
function removeLastChar (word) {
console.log(word)
if (word.length === 0) {
return
}
setTimeout(() => {
removeLastChar(word.replace(/\w$/, ''))
}, 1000)
}
removeLastChar(word)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment