Skip to content

Commit

Permalink
Fix var-declared variable
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-toto committed Jul 1, 2018
1 parent 0cb3f6b commit ed8edc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/plugin/MarkdownParser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MarkdownIt from 'markdown-it'

export function MarkdownParser (code, parsers) {
var converter = MarkdownIt()
let converter = MarkdownIt()
parsers.forEach(parser => {
converter = converter.use(parser)
})
Expand Down

2 comments on commit ed8edc8

@dark-flames
Copy link
Member

Choose a reason for hiding this comment

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

But we usually use let instead of var in ES6

@lin-toto
Copy link
Member Author

Choose a reason for hiding this comment

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

A variable declared using var can end up having an unexpected effective scope. It actually makes no difference in this case but people generally discourage the use of var and switch to let or const instead.

Please sign in to comment.