Unable to implement Set data structure

Tell us what’s happening:
I think I’ve written the code according to the given conditions but it seems to faill nearly all the tests.

Your code so far

class Set {
constructor() {
  // Dictionary will hold the items of our set
  this.dictionary = {};
  this.length = 0;

// This method will check for the presence of an element and return true or false
has(element) {
  return this.dictionary.indexOf(element) > -1;

// This method will return all the values in the set
values() {
  return Object.keys(this.dictionary);

    return true;
  return false;

  var idx = this.dictionary.indexOf(item);
  if(idx === -1){
    return false;
    return this.dictionary.splice(idx,1)[0];

  return Object.keys(this.dictionary).length;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0.

Challenge: Create a Set Class

Link to the challenge:

2 posts were merged into an existing topic: Can’t pass tests for Set data structure