Skip to content

Instantly share code, notes, and snippets.

View jpke's full-sized avatar

JP Earnest jpke

View GitHub Profile

Palindromes

A palindrome is a word, phrase, or number that is spelled the same forward and backward. For example, “dad” is a palindrome; “A man, a plan, a canal: Panama” is a palindrome if you take out the spaces and ignore the punctuation; and 1,001 is a numeric palindrome. We can use a stack to determine whether or not a given string is a palindrome.

Write a function that takes a string of letters and returns true or false to determine whether it is palindromic. For example:

function is_palindrome(s) {
    s = s.toLowerCase().replace(/[^a-z]/g, "");
    // your code goes here
}
@jpke
jpke / Node_Drills_1_1_5
Last active October 11, 2016 18:53
Request and Response Drills
Mad Lib Generator
https://hyperdev.com/#!/project/brook-rat
'use strict';
// Request and response object drills
// ==================================
const express = require('express');
const app = express();