Skip to content

Instantly share code, notes, and snippets.

@robgmerrill
Created August 2, 2018 08:58
Show Gist options
  • Save robgmerrill/68898456ff26ac52be49fe56e535c52e to your computer and use it in GitHub Desktop.
Save robgmerrill/68898456ff26ac52be49fe56e535c52e to your computer and use it in GitHub Desktop.
// source http://jsbin.com
<!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">
// Reverse a String
// 'car' -> 'rac'
// 'bar' -> 'rab'
function revString(str) {
return str.split('').reverse().join('');
}
console.log(typeof(revString('car')));
console.log(revString('bar'));
</script>
<script id="jsbin-source-javascript" type="text/javascript">// Reverse a String
// 'car' -> 'rac'
// 'bar' -> 'rab'
function revString(str) {
return str.split('').reverse().join('');
}
console.log(typeof(revString('car')));
console.log(revString('bar'));</script></body>
</html>
// Reverse a String
// 'car' -> 'rac'
// 'bar' -> 'rab'
function revString(str) {
return str.split('').reverse().join('');
}
console.log(typeof(revString('car')));
console.log(revString('bar'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment