Skip to content

Conversation

SwathiUppu
Copy link

Added index.html and script.js for Day 1 assignment.

var palindromeCheck = function(palindromeValue) {
var value = (palindromeValue) ? palindromeValue : document.getElementById("palindrome").value;
var palindrome = value.split("");
if (value === palindrome.reverse().join("")) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try to see if you avoid using reverse() and join() to achieve this ?

var arrayRepeat = function() {
var array = [1, 2, 3, 5, 8, 4, 7, 9, 1, 4, 12, 5, 6, 5, 2, 1, 0, 8, 1, 12, 9];
var finalArray = [];
for (var i = 0; i <= array.length; i++) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try to see if you avoid 2 levels of looping ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants