You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> The `JSON.parse()` static method parses a JSON string, constructing the JavaScript value or object described by the string. An optional reviver function can be provided to perform a transformation on the resulting object before it is returned.
Check it out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/efdb0e3d0ab937f7901ce3047626b5fd/580aa27e4fb61fbfe3eead0cd21971a6ff084174).
45
+
46
+
### ❌ Example of incorrect code
47
+
48
+
```js
49
+
import {operator} from'putout';
50
+
51
+
const {fromJS} = operator;
52
+
JSON.parse(fromJS(print(ast)), null, 4);
53
+
```
54
+
55
+
### ✅ Example of correct code
56
+
57
+
```js
58
+
import {operator} from'putout';
59
+
60
+
const {fromJS} = operator;
61
+
JSON.parse(fromJS(print(ast)));
62
+
```
63
+
64
+
## apply-rest
65
+
66
+
> The rest parameter syntax allows a function to accept an indefinite number of arguments as an `array`, providing a way to represent variadic functions in JavaScript.
> The `JSON.parse()` static method parses a JSON string, constructing the JavaScript value or object described by the string. An optional reviver function can be provided to perform a transformation on the resulting object before it is returned.
Check it out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/efdb0e3d0ab937f7901ce3047626b5fd/580aa27e4fb61fbfe3eead0cd21971a6ff084174).
113
-
114
-
### ❌ Example of incorrect code
115
-
116
-
```js
117
-
import {operator} from'putout';
118
-
119
-
const {fromJS} = operator;
120
-
JSON.parse(fromJS(print(ast)), null, 4);
121
-
```
122
-
123
-
### ✅ Example of correct code
124
-
125
-
```js
126
-
import {operator} from'putout';
127
-
128
-
const {fromJS} = operator;
129
-
JSON.parse(fromJS(print(ast)));
130
-
```
131
-
132
-
## apply-rest
133
-
134
-
> The rest parameter syntax allows a function to accept an indefinite number of arguments as an `array`, providing a way to represent variadic functions in JavaScript.
0 commit comments