简体   繁体   English

我正在学习 JavaScript 谁能告诉我我做错了什么? 总和应该给我和8

[英]Im learning JavaScript can anyone tell me what Im doing wrong? The sum is supposed to give me and 8

can anyone tell me what I have wrong?谁能告诉我我做错了什么?

 function main(name, num) { console.log("Maria"); console.log("5 + 3"); } main();

its suppose to give me 8它应该给我 8

"5+3" is a string. "5+3"是一个字符串。 Remove the quotations if you want to perform an arithmetic operation on the two numbers.如果要对两个数字执行算术运算,请删除引号。

 function main(name, num) { console.log("Maria"); console.log(5 + 3); } main()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM