scrimba
Note at 0:30
Go Pro!Bootcamp

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:30
AboutCommentsNotes
Note at 0:30
Expand for more info
main.js
run
preview
console
function differentSymbolsNaive(str) {
return str.split``.filter((e, i, arr) => arr.indexOf(e) === i).length
}



/**
* 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);
});
it('returns count of unique characters', () => {
// arrange
const str = 'cadbcaww';

// act
const result = differentSymbolsNaive(str);

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

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