LinMinquan's Blog

Experience technology to change life

javascript中以大括号当参数

udacity中有一例子,发现其直接把一对空的大括号当作参数传给一个函数,不知道这语法是什么意思。 library.js run.js 搜了下,其实这大括号(Curly braces)在javascript中表示的是object,空的大括号应该表示的是一个空的object,上面代码中在carlike里传了一个空的object,然后把这个object的loc赋值为1,最后return这个object为amy。 参考链接:https://stackoverflow.com/questions/4146984/curly-braces-inside-javascript-parameters-for-methods====== Udacity Front End Developer , Lesson 9 , 的最后一节14.Conclusion 也提到了它这只是 passing a empty object to the carlike decorator.   Read more →

前端笔记

HTML: 用来在屏幕上画一条线。 Use the tag to define a thematic change in the content https://www.w3schools.com/tags/tag_hr.asp Udacity HTML/CSS Style GuideHTML ValidatorMDN HTML Element Reference page.gives text strong importance, and is typically displayed in bold. stress emphasis CSS: # 后跟的是ID, . 后跟的是class [] 里跟的是attribute css它的代码被浏览器load是有顺序的,代码越后面,越迟被load,后面的代码会overwrite前面的代码,如果只是想稍微修改一下代码,可以在css的最后加一些代码。 CSS ValidatorGoogle Fonts Box-ShadowWeb Safe FontsDevice Independent Pixels VS Hardware Pixels Device Pixel Ratio = ( Hardware pixels) / ( Device Independent Pixels ) =======width + max-width====== CSS中指定了一张图片的width(例如width: 1024px),那再指定max-width: 100%会有什么效果。 Read more →