scrimba
Note at 0:31
Go Pro!

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Note at 0:31
AboutCommentsNotes
Note at 0:31
Expand for more info
main.js
run
preview
console
differentSymbolsNaive=s=>[...new Set(s)].length
////////10////////20////////30////////40////////50////////60////////70////////80////////90///////100

// [DAY 17] score: 47

/*
** javascriptmas golf rules:
** - the original test suite must pass and not be modified
** - the solution must generally work (edge cases aren't important unless stated in the problem)
** - each character in the code above counts as a stroke (including whitespace)
** - lowest score wins
*/

/**
* Test Suite
*/
describe('differentSymbolsNaive()', () => {
it('returns count of unique characters', () => {
// arrange
const str = 'cabca';

// act
const result = differentSymbolsNaive(str);

// log
console.log("result: ", result);

// assert
expect(result).toBe(3);
});
});
Console
"result: "
,
3
,
/index.html
LIVE