Math.round():四捨五入
Math.round(3.14) // 3 Math.round(5.49999) // 5 Math.round(5.5) // 6 Math.round("5.50001") // 6 Math.round(-5.49999) // -5 Math.round(-5.5) // -5 Math.round(-5.50001) // -6
1 | flex-flow: flex-direction flex-wrap; |
#flex-start:起點
#flex-end:終點
#center:置中
#space-between::是平均分配「元素」位置,但左右兩側會貼齊主軸的起點、終點
#space-around:是平均分配「元素」位置,但左右兩側的間距會較小 | Space-evenly是「元素」和「左右兩側」的間距皆相同;
設置對像是行內成員,該屬性可以控制彈性容器中成員在當前行內的對齊方式。當成員設置了align-self 屬性時,父容器的 align-items 值則不再對它生效;行內成員會在其邊界盒正交軸上被居中(如果行正交尺寸小於行內成員尺寸,行內成員將會在正交軸兩方向等量溢出)
所有行被集中(擠)在彈性容器(正交軸)中間。它們彼此之間齊平,並且跟彈性盒子正交起始邊界的空白與跟彈性盒子正交結束邊界的空白相等。 (如果溢出空白為負數,所有行將會在正交軸兩方向等量溢出)鏈接。 )
#flex
1 | flex:flex-grow | flex-shrink | flex-basis |
1 | flex-grow: number; |
1 | flex-basis: number|auto|initial|inherit; |
const stringObj = new String('foo'); const newObj=stringObj.toString(); console.log(newObj) //"foo"
const sentence = 'The quick brown fox jumps over the lazy dog.'; console.log(sentence.toLowerCase()); //the quick brown fox jumps over the lazy dog.
const sentences = 'The is apple.'; console.log(sentences.toUpperCase()); //"THE IS APPLE."
const greeting = ' Hello world! '; const greetingTrim=greeting.trim(); console.log(greetingTrim); //Hello world!"
const greetTrimEnd=greeting.trimEnd(); console.log('清除結束的空白',greetTrimEnd) //"清除結束的空白" " Hello world!"
greenTrimStart=greeting.trimStart();;console.log(‘清除開始的空白’,greenTrimStart)
//“清除開始的空白” “Hello world! “
const str = 'The quick brown fox jumps over the lazy dog.'; const strSplit=str.split(''); console.log('strSplit',strSplit) //'strSplit' ["T","h","e"," ","q","u","i","c","k"," ","b","r","o","w","n"," ","f","o","x"," ","j","u","m","p","s"," ","o","v","e","r"," ","t","h","e"," ","l","a","z","y"," ","d","o","g","."]