最近面了一个前端,感觉很满意,分享给大家

2020-10-10 17:02:33 +08:00
 duanxiaoyu

B 站链接: https://www.bilibili.com/video/BV18f4y1B7xh/

8204 次点击
所在节点    推广
31 条回复
weitch
2020-10-11 10:21:31 +08:00
@wxsm #15
在开发时基本很少会手动注释某一行,不都是在开发者工具里点勾或取消?
Gathaly
2020-10-11 10:50:11 +08:00
一看就是广告,上面的为啥这么激动

面试内容明显就是按剧本演的啊,而且都是适配他那个在线工具出的,特别简单
yhxx
2020-10-11 11:04:09 +08:00
规范里确实没有 "// "


4.1.9 Comments
Comments begin with the characters "/*" and end with the characters "*/". They may occur anywhere outside other tokens, and their contents have no influence on the rendering. Comments may not be nested.

CSS also allows the SGML comment delimiters ("<!--" and "-->") in certain places defined by the grammar, but they do not delimit CSS comments. They are permitted so that style rules appearing in an HTML source document (in the STYLE element) may be hidden from pre-HTML 3.2 user agents. See the HTML 4 specification ([HTML4]) for more information.


https://www.w3.org/TR/CSS21/syndata.html#comments

https://drafts.csswg.org/css-syntax-3/#consume-comment
wxsm
2020-10-11 12:10:21 +08:00
@weitch 我只是提出我的意见。大家看到如果不知道的,就当学习了。其实我觉得这是很基础的东西,如果我是面试官,看到别人这么写注释,我可能会追问他:

1. 你知道 css 注释这么写会发生什么事吗?
2. 如果我们就是想用行内注释,该怎么办?

这里往下走其实就到了 css hack 与 css 预编译器环节了。无意中使用的行内注释,看起来好像起了作用,但是实际上已经成为了 hack,浏览器能不能解析,怎么解析,完全看各自实现。

IDE 当然可以解决很多问题,但是按照 4 年经验的职业前端开发来说,我觉得这点基础应该是要有的。
Desiree
2020-10-11 12:13:07 +08:00
这完全没有问具体做了什么项目啊。。。这都能给 16k 吗
user8341
2020-10-11 12:34:22 +08:00
@wxsm
我承认 css 这么写确实不是标准。同时也很想知道哪个浏览器实现用 // 注释会解析成别的意思。
ljpCN
2020-10-11 12:39:28 +08:00
setTimeout 单位是 ms 不是 s,应该让面试者自己想一想的,不应该直接提醒。
1194129822
2020-10-11 15:13:55 +08:00
CSS 我不会外,其他感觉好简单,手写一个实现 promiseA+规范的 promise 都没有
Keyes
2020-10-11 15:27:58 +08:00
@wxsm 推 w3c 标准难啊,当年推去表格排版的时候也是被各种大佬和菜鸟怼
GzhiYi
2020-10-11 15:37:27 +08:00
这是中级啊?都很简单啊

哦,广告来的,打扰了。
Sapp
2020-10-11 20:55:42 +08:00
@wxsm = = 那我这样几年不单独写 css,一直是写 css in js 的估计就直接挂了。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/713726

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX