MCPcopy
hub / github.com/ygs-code/vue / repeat

Function repeat

vue.js:918–933  ·  view source on GitHub ↗
(str, n)

Source from the content-addressed store, hash-verified

916 *重复 递归 除2次 方法+ str
917 * */
918 var repeat = function (str, n) {
919 var res = '';
920 while (n) {
921 if (n % 2 === 1) {
922 res += str;
923 }
924 if (n > 1) {
925 str += str;
926 }
927 n >>= 1;
928 //16 8
929 //15 7 相当于除2 向下取整2的倍数
930 //console.log( a >>= 1)
931 }
932 return res
933 };
934 /***********************************************************************************************
935 *函数名 :generateComponentTrace
936 *函数功能描述 : 生成组建跟踪 vm=vm.$parent递归收集到msg出处。

Callers 1

vue.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected