jashkenas / jashkenas/underscore
_.size to return symbol count of strings.
- Dominant language
- JavaScript
- Stars
- 27.3k
- Forks
- 5.4k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 1
Description
Continuing the [discussion](https://github.com/jashkenas/underscore/commit/bdb06bcfcdcc85bfe3b494d9907762945f7d7c49#commitcomment-13243061), at the moment:
``` js
_.size('💕')
// => 2
```
Since `str.length` is trivial I think it --may-- be handy if `_.size` returned the number of symbols in a string instead.
``` js
_.size('💕')
// => 1
```
Contributor guide
Research direction
Start at the _.size entry point and review the linked discussion to understand the intended string-counting behavior. Determine whether “symbol” means code points or another unit, then add coverage for the emoji example and verify the existing collection behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100