---
title: "Discussion on \"01 Print Pattern - Basic Coding Question (JS)\" | Hashnode"
description: "Discussion on \"01 Print Pattern - Basic Coding Question (JS)\". A. Simple Pattern\n1.Print a horizontal line of stars.\n// *****\nconst horizontalLine = function (n) {\n    let str = \"\"\n    for (let i = 1; i <= n; i++)\n        str += \"*\";\n\n    console.log(str);\n}\nhorizontalLine(5)\n\n2.Print a vertical line of stars.\n/..."
url: "https://hashnode.com/posts/01-print-pattern-basic-coding-question-js/65d4a9560defbc98b78fc58d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [01 Print Pattern - Basic Coding Question (JS)](https://krayush1109-dsa.hashnode.dev/01-print-pattern-basic-coding-question-js?utm_source=hashnode&utm_medium=feed)

A. Simple Pattern 1.Print a horizontal line of stars. // \*\*\*\*\* const horizontalLine = function (n) { let str = "" for (let i = 1; i <= n; i++) str += "\*"; console.log(str); } horizontalLine(5) 2.Print a vertical line of stars. /...

Feb 20, 2024 · 3 min read · krayush1109-dsa.hashnode.dev  
Read the article

-   [#star-pattern](https://hashnode.com/tag/star-pattern)
-   [#patterns](https://hashnode.com/tag/patterns)

## Written by

[Ayush Kumar](https://hashnode.com/@krayush1109)

@krayush1109 · Bhopal

  
[View profile](https://hashnode.com/@krayush1109)

MERN Stack Developer

A passionate MERN Stack Developer from India I am a full stack web developer with experience in building responsive websites and applications using JavaScript frameworks like ReactJS, NodeJs, Express etc.,

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
