These 2 code blocks function exactly the same in a snippet from an Angular 2 service. If there is only one statement in the function body of the "then", is it safe to say that a "return" statement is unnecessary and that these blocks of code are identical in operation?
getTodos(): Promise<Todo[]> {
return this.http.get(this.todosUrl)
.toPromise()
.then(response => response.json() as Todo[])
This code block has a "return" statement in the "then"
getTodos(): Promise<Todo[]> {
return this.http.get(this.todosUrl)
.toPromise()
.then(response => { return response.json() as Todo[]})