Question: I want to create a management page where an admin can delete users. I have succesfully made it list created users, but now i'm struggeling with how to create a deleteView to delete the user entirely from my django project.

Views.py

```
def index(request):
    users = User.objects.all()
    return render(request, 'EditUser.html',{'userlist':users})

def deletefunction(request,User =None):
    object = User.objects.get(id=User)
    object.delete()
    return render(request,'EditUser.html')

```

Project urls.py

```
from edit_user.views import deletefunction

urlpatterns = [
    path('admin/', admin.site.urls),
    path('management', include('management.urls')),
    path('management/create', include('signup.urls')),
    path('management/edit', include('edit_user.urls')),
    path('^delete/(?P<User>[0-9]+)/$', deletefunction, name='delete_view'),
]

```

HTML code 

```
<div class="container">
          {% for item in userlist %} 
          <tr> 
              <td>{{ item.username }}</td><a href="{% url 'EditUser:deletefunction' User %}">delete</a> 
          </tr>  
          {% endfor %} 

          </div>

```

As of right now when i'm trying to load my page i'm receiving this exception. 

> 
> Reverse for 'deletefunction' not found. 'deletefunction' is not a
>  valid view function or pattern name.
> 
> 
>

Answer: 
Because 

```
typeof new String('Hello') === 'object'

```

and 

```
typeof 'Hello' === 'string'

```

The former is an object, the latter is a primitive.

The `==` check works because the `String` object has also `toString` method and JS invokes that method in this case (as well as when concatenating with other string).
A string object is not a primitive string and therefore will not be equal completely by using `===`. 
Instead, if you insist on using `===` you can use the `valueOf` function, like: 

```
new String("hello").valueOf() === str2

```