Grepsy/jQCloud — comment on commit 74b2e6aa74c609c3d353142587f386fac3a86df8
File:  line 0
By DukeLeNoir:

Grepsy,
thanks for pointing out the bug, shame to me I did not catch it before ;)
I can't merge your pull request, because it causes tests to fail. The reason is that the `if` condition comes after the creation of the word span (line 103), so all words are assigned a weight of 5, no matter the original weights. Also, in the comparison, `word_array[0]` should be expected to have a higher weight than `word_array[word_array.length - 1]`.
An option could be to use a ternary operator when assigning the weight, like:

```javascript
weight = (word_array[0].weight > word_array[word_array.length - 1].weight) ? Math.round(/* weight calculation here */) : 5;
```

Would you mind modifying your pull request to fix these issues?
Thank you!

Luca