由于本人是写java的,lambda在Java中是不用写return是会编译报错的。

js 箭头函数返回undefined;

要么去掉中括号,要么写return;

而在js中,则不报错,打印出来的值是undefined

js 箭头函数返回undefined;

console.log(reqAddress("40.10038,116.36867"))===undefined。

其中ajax函数返回一个Promise。

虽然Java很繁琐,但是很多语法问题在编译阶段就解决了,算是编译型语言的好处吧

相关文章:

  • 2022-12-23
  • 2021-06-07
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-19
  • 2021-11-22
  • 2022-01-09
  • 2022-02-08
  • 2021-09-01
  • 2021-11-21
  • 2022-12-23
相关资源
相似解决方案