Skip to content

Day 1 assignment. #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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