Closed yuleiQ closed 1 year ago
Hi @yuleiQ, thank you for the comment.
The this.lines
seems to contain undefined
. Your code has a bug maybe.
However, of course I didn't read other parts of your code.
For example, that checks this.lines.length
wastefully, you can replace the line with:
if (this.lines) {
Because the .forEach()
method does nothing when the array is empty.
This may help you: https://jsfiddle.net/xqd92ke8/
Hi @yuleiQ, thank you for the comment. The
this.lines
seems to containundefined
. Your code has a bug maybe. However, of course I didn't read other parts of your code. For example, that checksthis.lines.length
wastefully, you can replace the line with:if (this.lines) {
Because the
.forEach()
method does nothing when the array is empty.
I tried, it seems that it is not because of the error here, because my lines are an array
Try this example code: https://github.com/anseki/leader-line/issues/386#issuecomment-1369781207
The forEach()
problem is another problem of your code. That doesn't throw an error but it makes wrong behavior wastefully.
No reply came, then this abandoned issue is closed.
when I call position(), display error, but I don't know why