Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Test for case-insensitivity and give hints #41

@martinheidegger

Description

@martinheidegger

I got reminded in nodeschool/discussions#700 that sometimes the problem occurs that people don't see the difference in their output. uppercase/lowercase etc. It might be good to check something like:

function normalise(string) {
   return string.replace(/\.|\!|\?|\s|/g, "").toLowerCase()
}

function isProbablyTypo(expectedAnswer, answer) {
   return normalise(expectedAnswer) === normalise(answer)
}

if (isProbablyTypo(expectedAnswer, answer)) {
   console.log("Looks like you did the right thing but maybe you had a typo in there. We are a little picky to make sure that you understood the question. Maybe you want to check for typos?")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions