javascript - Getting "Undefined" value for Variable even though i have defined variable
问题描述
HI I have defined variable called "const VA" but in output it is coming undefine cause of that i am not able to see values inside it below is my code.
function createAddress(streetA, cityA, zipcodeA) {
return
{
streetA, cityA, zipcodeA;
}
}
const VA = createAddress("405", "newyork", "123456");
console.log(VA);
Output is undefined
解决方案
.之后的括号不能有换行符return
。改用这个:
return {
value,
value2,
value3
}
推荐阅读
- python - 使用 python django 获取下拉列表 ID 并保存到 view.py 文件中
- javascript - 如何使用 onWrite 的事件
- python - 在 python 中显示来自 Flask 的 Json 格式输入
- regex - 左括号和右括号之间的值
- google-bigquery - 错误:未找到:在美国位置找不到数据集 my-project-name:domain_public
- git - 从管道作业的 Jenkins Blueocean UI 中删除分支和提交选项
- vim - 如何使用 Nix 包管理器安装带有自定义编译选项的 Vim?
- pyqt5 - 如何从 PyQt 的主窗口打开和关闭新窗口?
- php - 如何在 PHP 中使用 DEFINE 连接字符串和变量
- cakephp - 使用控制器中的另一个操作处理发布操作