I can use this way to prevent undefined error when the object is undefined , but it not work in React. i want to know is this ES6’syntax or other syntax?
-
Why is it related to Angular?Harry Ninh– Harry Ninh2017-02-23 03:19:39 +00:00Commented Feb 23, 2017 at 3:19
-
sorry ; forgot to say that: i can use this syntax in angular2 project.but doesn't work in react projectjunk– junk2017-02-23 03:25:55 +00:00Commented Feb 23, 2017 at 3:25
-
2"EC6’syntax or other syntax?" Not it's not. Seems to be some custom syntax from angular.Felix Kling– Felix Kling2017-02-23 03:43:06 +00:00Commented Feb 23, 2017 at 3:43
Add a comment
|
1 Answer
The safe navigation operator is a feature of Angular, and not part of the JavaScript langauge. As a result, it will not work in React applications.