Skip to content

HeinNaing/Knock_knock_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Knock - Knock Generator

This project is a simple JavaScript program that generates random knock-knock jokes. The jokes are constructed from predefined collections of phrases and names, ensuring a variety of combinations for each joke.

Tables of contents

Introduction

This is a JavaScript project that generates random knock-knock jokes using a set of predefined collections. The project is aimed at providing a fun way to understand basic JavaScript concepts such as arrays, functions, and loops.

Features

  • Generates random knock-knock jokes.
  • Uses predefined collections of phrases and names.
  • Capitalizes the first letter of each joke component.
  • Ensures a variety of joke combinations.

Usage

To use the knock-knock joke generator, simply run the JavaScript code in a browser console or a Node.js environment. The program will output a complete knock-knock joke to the console.

Code Explanation

const collection = {
    knock: ["Knock, knock"],

    firstQuestion: ["Who's there ?"],

    knockNames: ["Annie", "Lettuce", "Boo", "Cow", "Tank", "Harry", "Atch", "Olive", "Orange", "Europe", "hein"],

    secondQuestion: ["Who?"],

    secondAnswer: ["you doing today?", "it take to get you to open the door?", "not, here I come!", "be a better punchline than this!", "SO YOU CAN HEAR ME!", "come out now?", "you know unless you open the door?"]
}

Collaborators

About

This project generates text for knock knock jokes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published