Commit 449595e
Fix js variable debugging for complex variables
When debugging with string interpolation it would work for basic types,
like:
```javascript
> const a = 'some string';
undefined
> console.log(`a: ${a}`)
a: some text
undefined
```
But if you try to print an object/array, you get:
```javascript
> const b = {foo: 'bar', baz: ['h', 'a', 'm']}
undefined
> console.log(`b: ${b}`)
b: [object Object]
undefined
```
To solve this we could either stringify it, or we could pass the var as
another arg, which allows for inspecting it when on browser:
```javascript
> const b = {foo: 'bar', baz: ['h', 'a', 'm']}
undefined
> console.log(`b: `, b)
b: { foo: 'bar', baz: [ 'h', 'a', 'm' ] }
undefined
```1 parent c5536ab commit 449595e
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments