Question: Helo friends i have coded a js script to find out the value of this in a function.The code is

```
function hello(this) {
this.value = 10;
document.write(this);
};

var c = new hello(c);
c();

```

But i get this output as blank...I know this depends upon how the function is called and here c is the value of this..So the output must be c.

Do i wanna change `new hello(to any string)` here or just c like i did.

Please help me to solve this and make me correct...Any help would be appreciated ..Thanks..

Answer: 
First, you need to note that you are creating class variables in `SomeClass`, not instance variables

```
class SomeClass(object):
    def __init__(self, name = "whatever", task = "nothing"):
        self.name = name
        self.task = task

```

Now we have designed a class, which accepts two keyword arguments with default values. So, if you don't pass values to any of them, by default `whatever` will be assigned to `name` and `nothing` will be assigned to `task`.

```
class ChildClass(SomeClass):
    def __init__(self, name = "whatever", task = "nothing"):
        super(ChildClass, self).__init__(name, task)

child1 = ChildClass(task = "sometask")
print child1.name, child1.task
# whatever sometask
child2 = ChildClass()
print child2.name, child2.task
# whatever nothing

```
You need to overwrite its **initializer** (sort of like a constructor in other languages):

```
>>> class SomeClass:
...   name='whatever'
...   task='nothing'
...
>>> class ChildClass(SomeClass):
...   def __init__(self, name=None, task=None):
...     if name is not None:
...       self.name = name
...     if task is not None:
...       self.task = task
...
>>> child = ChildClass(task='sometask')
>>> child.name
'whatever'
>>> child.task
'sometask'
>>> child2 = ChildClass()
>>> child2.task
'nothing'

```