前端笔试

1.为禁用button按钮添加样式
input[type="text"]:disabled
{ 
   background-color: #dddddd;
}
2.数组join方法

数组拼接方法:

​ join: 数组.join(‘连接符’);

​ 连接符默认是,

​ 连接符可以是一切字符 包括标签

​ 将数组组成字符串之后再返回

<script type="text/javascript">

var arr = new Array(3)
arr[0] = "George"
arr[1] = "John"
arr[2] = "Thomas"

document.write(arr.join())

</script>
输出:

George,John,Thomas
3.rem相对什么
rem是指相对于根元素的字体大小的单位,即根据html元素的font-size来计算大小。 比如说 html 的 font-size 大小为 100px, 一个 div 的 width 为 1rem,则 div 的 width大小为100px
4. typeof 箭头函数
var foo = {
    a:() =>{
        console.log(foo)
    }
}

console.log(typeof foo.a) // function
5.CSS继承
  • 子标签可以继承父标签的样 式(text-,font-, line-, list- 这些前缀开头的大多都可以继承,以及color属性。

    • color
    • text-align
    • text-indent
    • font-size
    • font-family
    • font-style
    • font-weight
    • line-height
    • list-style
  • text-decoration 特殊说明 文本装饰属性的样式会延伸,不是继承

6. 代码
function test(){
    console.log(a) // undefined
    var b = a || 5
    var a = 7
    console.log(b) // 5
}
test()
['1','2','3'].map(parseInt)parseInt('1',0);radix 为 0,parseInt() 会根据十进制来解析,所以结果为 1parseInt('2',1);radix 为 1,超出区间范围,所以结果为 NaNparseInt('3',2);radix 为 2,用2进制来解析,应以 01 开头,所以结果为 NaN
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值