Skip to content

[Harsh review] Add print-numbers.js - #1

Open
kendaleiv wants to merge 1 commit into
mainfrom
js-print-numbers
Open

[Harsh review] Add print-numbers.js#1
kendaleiv wants to merge 1 commit into
mainfrom
js-print-numbers

Conversation

@kendaleiv

Copy link
Copy Markdown
Owner

No description provided.

@kendaleiv kendaleiv changed the title Add print-numbers.js [Harsh review] Add print-numbers.js Oct 3, 2024

@kendaleiv kendaleiv left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address my comments.

Comment thread print-numbers.js
@@ -0,0 +1,5 @@
function printNumbers() {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no tests for this method. Please add them.

Comment thread print-numbers.js
@@ -0,0 +1,5 @@
function printNumbers() {
for (var i = 1; i <= 10; i++) {
console.log(i);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use a logging library, rather than logging with console.

Comment thread print-numbers.js
@@ -0,0 +1,5 @@
function printNumbers() {
for (var i = 1; i <= 10; i++) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't only count to 10, it should accept the number to count to as a parameter.

Comment thread print-numbers.js
@@ -0,0 +1,5 @@
function printNumbers() {
for (var i = 1; i <= 10; i++) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var

Comment thread print-numbers.js
@@ -0,0 +1,5 @@
function printNumbers() {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function isn't invoked.

Comment thread print-numbers.js
for (var i = 1; i <= 10; i++) {
console.log(i);
}
} No newline at end of file

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file doesn't end with a newline.

Comment thread print-numbers.js
@@ -0,0 +1,5 @@
function printNumbers() {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no documentation for how to use this.

Comment thread print-numbers.js
@@ -0,0 +1,5 @@
function printNumbers() {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use 2 spaces for indentation, not 4.

@kendaleiv

Copy link
Copy Markdown
Owner Author

Add a PR description, it's blank. Amend your commit to include the same text.

Comment thread print-numbers.js
@@ -0,0 +1,5 @@
function printNumbers() {

@kendaleiv kendaleiv Oct 3, 2024

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to displayNumbers. Rename the file. Update the PR title.

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.

1 participant