七爪源码:让我思考的 JavaScript 面试问题 我真的了解 JavaScript 吗

七爪源码:让我思考的 JavaScript 面试问题 我真的了解 JavaScript 吗

JavaScript 最让我惊讶的部分是它周围总是有新事物发生。 而且,无论您对它了解多少,您都将始终了解有关它的新事物。

这些问题我收集了很长时间。 在大多数问题中,我真的不知道输出会是什么,直到我自己尝试了它们。

所以在这里我将它们记录下来,以便其他人可以利用它来学习新概念

输出:

21{name: “Lydia”} // age won’t be included. Because property defined with defineProperty are non enumerable by default.

输出:

false // delete operator only deletes a key in objecttrue // when we don’t use any declaration before any variable, it will be treated as a global variable, and will be added as deletable entity in window object.undefined

输出:

[ { name: “Noren Red”} ] Initially I thought it will log [ null ] because we have initialised person with nullBut in reality, we are only setting new reference to person variable. Previous reference will be used in members arrayIn Short, { name: “Noren Red”} lives in some memory space whose address is X201and this is how referencing is workinglet person = X201const members = [ X201 ]person = null

输出:

Silver Surfer Because when we return a property, the value of the property is equal to the returned value, not the value set in the constructor function.

输出:

With the padStart method, we can add padding to the beginning of a string. The value passed to this method is the total length of the string together with the padding. The string “Silver Surfer” has a length of 13. name.padStart(14) inserts 1 space at the start of the string, because 13 + 1 is 13. If the argument passed to the padStart method is smaller than the length of the array, no padding will be added.

输出:

777If we pass string and number combination to parseInt, what parseInt does is, it check at which position wrong datatype is getting started, if value before the wrong datatype is a valid number, it will return the valid number.

输出:

1 2 and undefined 3 and undefined 4 If we don’t pass initial value, then by default x will be first value of array, and y will be second value of array.

输出:

one – [“”, ” is “, ” years old”]two – Thorthree – 1000one – [“hey there, are you amazed”]two – undefinedthree – undefinedIf we use tagged template literals, the value of the first argument is always an array of the string values.The remaining arguments get the values of the passed expressions!

输出:

1undefined2

输出:

function // Classes in JS are functions under the hood

关注七爪网,获取更多APP/小程序/网站源码资源

郑重声明:本文内容及图片均整理自互联网,不代表本站立场,版权归原作者所有,如有侵权请联系管理员(admin#wlmqw.com)删除。
(0)
用户投稿
上一篇 2022年6月22日
下一篇 2022年6月22日

相关推荐

  • 888元的一周泰国游,为什么这么便宜?看完你还敢去吗

    泰国是东南亚地区发展的相对来说很不错的一个国家,近些年来凭借着大力发展旅游产业而重新获得了新的发展动力,一跃而成一个很受欢迎的国家。 (此处已添加小程序,请到今日头条客户端查看) …

    2022年8月11日
  • 张萌:稻盛和夫去世,留下一条真理

    就在前两天,我听闻稻盛和夫先生去世的消息,内心很沉重,因为他是我一位非常敬重的男神。过去在我人生很困难的时候,他的书给了我解决方案,陪我度过了这段难捱的时光。 他是日本的著名企业家…

    2022年9月5日
  • 互联网医院分析之行业调研

    编辑导读:如今除了传统的医院就诊,互联网医院的数量也越来越多。互联网医院是指取得《医疗机构执业许可证》(互联网医院牌照),提供互联网诊疗服务的医疗机构,是对现下医疗系统的一个补充。…

    2022年6月23日
  • 关于氧气背后的知识你知道吗?

    氧气的性质 图片来源于网络 定义: 氧气,空气主要组分之一,比空气重,标准状况(0 和大气压强101325帕)下密度为1.429克/升。无色、无臭、无味。在水中溶解度很小。压强为1…

    2022年7月21日
  • 使用Windbg静态分析dump文件(实战经验总结)

    在日常分析C++软件异常的日常工作中,大多数情况下我们都是使用Windbg去静态分析dump文件去排查软件异常的,今天我们就来详细地讲一下如何使用Windbg去静态分析dump文件…

    2022年7月12日
  • 夏天的微醺

    走进夏天,给人的第一感觉是热,是潮,是更多的蚊虫,但是你忽略了夏天带来微醺的感觉。 这是一种让人沉醉其中而不自知的朦胧。这是一种让人欲罢而不能的无力。

    2022年6月28日
  • 碳酸锂价格重回上升通道

    碳酸锂|价格文章来源自:高工锂电网 2022-06-14 08:47:32 阅读:1908 随着疫情得到控制,新能源汽车、动力电池企业有序推进复工复产,碳酸锂需求端回暖,价格连续两…

    2022年6月17日
  • 糊了、凉了、丑了,8届金鹰女神,只有3人红到如今

    二年一度的金鹰节颁奖礼又来了,除了每年的奖项备受关注外,金鹰女神也是各位网民讨论的对象,然而时过境迁,已经选出的8位金鹰女神现在发展也各不相同,差距明显。 1、刘亦菲 刘亦菲19岁…

    2022年7月15日
  • 重大事故!日本发生大规模通信故障 紧急电话也无法拨打

    央视财经微信公号 昨天凌晨起,日本第二大移动运营商KDDI因设备问题突发通信故障,给整个日本社会造成了不小的影响。 日本第二大移动运营商突发大规模故障 记者来到KDDI旗下的一家手…

    2022年7月3日
  • 荣耀Magic4 至臻版点评:Up主心中最强拍照手机

    这期视频并非严格意义的评测,更多是主观分享荣耀Magic4 至臻版的影像。既看看荣耀最强的影像旗舰表现如何,也看看独立一年的荣耀在影像上的理解和变化。也欢迎大家在看完之后,分享你的…

    2022年6月12日

联系我们

联系邮箱:admin#wlmqw.com
工作时间:周一至周五,10:30-18:30,节假日休息