Skip to content

Commit

Permalink
Merge pull request #3 from wizard04wsu/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
wizard04wsu authored Aug 29, 2021
2 parents ef1ef23 + a82de6c commit 0d1fc03
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ Return value:
The **Type** class extends the **String** class. In addition to storing a type name, its properties reveal whether the tested value was an object or a primitive.

Syntax:
> `new Type(typeName, isPrimitive)`
> `new Type(typeName)`
> `new Type(typeName, objectType)`
Parameters:
- ***typeName*** - (string)
- ***objectType*** - (string) Optional. The object name used by `Object.prototype.toString()`. Pass this argument for object types only.
- ***objectType*** - (string) The object name used by `Object.prototype.toString()`. Include this for object types. Do not include this for primitive types.

| Property | Type | Description |
| --- | --- | --- |
| .**type** | string | The type name. This is also the instance's primitive value. |
| .**objectType** | string | The object name used by `Object.prototype.toString()`.. |
| .**primitive** | string | If the `objectType` argument was falsy when constructed, this property was set to the type name. Otherwise, it's undefined. |
| .**object** | string | If the `objectType` argument was truthy when constructed, this property was set to the type name. Otherwise, it's undefined. |
| .**type** | string | The type name (`typeName`). This is also the instance's primitive value. |
| .**objectType** | string | The object name used by `Object.prototype.toString()`. |
| .**primitive** | string | For primitive types, this property is set to `typeName`. Otherwise, it's undefined. |
| .**object** | string | For object types, this property is set to `typeName`. Otherwise, it's undefined. |

### Example

Expand Down

0 comments on commit 0d1fc03

Please sign in to comment.