lnl testing

In this example below you will see how to do a lnl testing with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by Ticolyle, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright Ticolyle ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>lnl testing</title>
  
  
  
  
  
</head>

<body>

  <div id="century">
  <p>1. Given a year, return the century it is in. The first century spans from the year 1 up to and including the year 100, the second - from the year 101 up to and including the year 200, etc.</p>
  <p id="century-input">302</p>
  <p id="century-output"></p>
</div>
<hr>
<div id="palindrome">
  <p>2. Given the string, check if it is a palindrome.
  <p id="palindrome-input">hlbeeykoqqqokyeeblh</p>
  <p id="palindrome-output"></p>
</div>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/Ticolyle/lnl-testing-xXbVrJ */
// 1. Given a year, return the century it is in. The first century spans from the year 1 up to and including the year 100, the second - from the year 101 up to and including the year 200, etc.
function centuryFromYear(year) {
  
}

// 2. Given the string, check if it is a palindrome.
function checkPalindrome(inputString) {
  return ( inputString.split().reverse().join() == inputString )
}

// 3. function AlphabetSoup(str) take the str string parameter being passed and return the string with the letters in alphabetical order (ie. hello becomes ehllo). Assume numbers and punctuation symbols will not be included in the string.
var alphaStr = 'HELLO';
function AlphabetSoup(alphaStr) { 
  return alphaStr.split('').sort().join('');
}

// Create a function called "looper" that when passed an array of numbers will increment each value in the array by 5 and then return the updated array.
// For example: if the looper function were to be passed [ 2, 7 ] it should return [ 7, 12 ]
function looper(arr) {
  
}

//4. Given an array of integers, find the pair of adjacent elements that has the largest product and return that product.
function adjacentElementsProduct(inputArray) {
  foreach
}
testArray = [5, 1, 2, 3, 1, 4]


/* 
var alphaStr = 'HELLO';
function AlphabetSoup(alphaStr) { 
  return alphaStr.split('').sort();
}
undefined
var alphaStr = 'HELLO';
function AlphabetSoup(alphaStr) { 
  return alphaStr.split('').sort().join('');
}
undefined
alphaStr
"HELLO"
alphaStr.split('')
(5) ["H", "E", "L", "L", "O"]
alphaStr.split('').sort()
(5) ["E", "H", "L", "L", "O"]
alphaStr.split('').sort().join('')
"EHLLO"
arr = [ 7, 12 ];
(2) [7, 12]
arr["key"]+=5;
NaN
arr[]+=5;
VM809:1 Uncaught SyntaxError: Unexpected token ]
arr.map(function(x) {
   return x + 5;
});
(2) [12, 17]

*/

Comments