<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Wangdanting123的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Wangdanting123</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Wangdanting123]]></copyright><item><title><![CDATA[函数防抖debounce方法 / 节流throttle方法]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/100380643</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/100380643</guid><author>Wangdanting123</author><pubDate>Mon, 02 Sep 2019 20:47:03 +0800</pubDate><description><![CDATA[防抖debounce：当持续触发事件时，一定时间段内没有再触发事件，事件处理函数才会执行一次。


function debounce(method, context) {
  clearTimeout(method.tId)
  method.tId = setTimeout(function() {
    method.call(context)
  }, 100)
}

function...]]></description><category></category></item><item><title><![CDATA[防篡改对象(不可扩展对象、密封对象、冻结对象)]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/100333332</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/100333332</guid><author>Wangdanting123</author><pubDate>Mon, 02 Sep 2019 17:47:23 +0800</pubDate><description><![CDATA[不可扩展对象：不能添加


var person = {name: 'wangdanting'};
Object.preventExtensions(person);

person.age = 23;
console.log(person.age); // =&gt; undefined

person.name = 'abc';
console.log(person.name); // =&g...]]></description><category></category></item><item><title><![CDATA[基本的函数柯里化curry方法]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/100331065</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/100331065</guid><author>Wangdanting123</author><pubDate>Mon, 02 Sep 2019 17:34:11 +0800</pubDate><description><![CDATA[function curry(fn) {
  var args = Array.prototype.slice.call(arguments, 1)
  return function() {
    var innerArgs = Array.prototype.slice.call(arguments)
    var finalArgs = args.concat(innerArgs)
 ...]]></description><category></category></item><item><title><![CDATA[基本的函数绑定bind方法]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/100330535</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/100330535</guid><author>Wangdanting123</author><pubDate>Mon, 02 Sep 2019 17:32:15 +0800</pubDate><description><![CDATA[function bind(fn, context) {
  return function() {
    return fn.apply(context, arguments)
  }
}

var greet = function(greeting, punctuation) {
  return greeting + " " + this.user + punctuation
}
var...]]></description><category></category></item><item><title><![CDATA[创建一个函数，调用func时，this绑定到创建的新函数，并且start之后的参数作为数组传入]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/100055977</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/100055977</guid><author>Wangdanting123</author><pubDate>Sat, 24 Aug 2019 18:53:50 +0800</pubDate><description><![CDATA[/**
 * 创建一个函数，调用func时，this绑定到创建的新函数，并且start之后的参数作为数组传入
 * Creates a function that invokes `func` with the `this` binding of the
 * created function and arguments from `start` and beyond provided as a...]]></description><category></category></item><item><title><![CDATA[检查value是否是一个原生函数]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/100040130</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/100040130</guid><author>Wangdanting123</author><pubDate>Fri, 23 Aug 2019 15:48:47 +0800</pubDate><description><![CDATA[/**
 * 检查value是否是一个原生函数
 * Checks if `value` is a pristine native function
 * @param {*} value The value to check
 * @returns {boolean} Returns `true` if `value` is a native function, else `false`
 *...]]></description><category></category></item><item><title><![CDATA[创建一个调用函数，使调用次数不操过n次，之后再调用这个函数，将返回一次最后调用func的结果]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/99948444</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/99948444</guid><author>Wangdanting123</author><pubDate>Wed, 21 Aug 2019 11:58:47 +0800</pubDate><description><![CDATA[/**
 * 创建一个调用函数，通过this绑定和创建函数的参数调用func，调用次数不操过n次，之后再调用这个函数，
 * 将返回一次最后调用func的结果
 * Creates a function that invokes `func`, with the `this` binding and arguments
 * of the created function, while it's...]]></description><category></category></item><item><title><![CDATA[计算数组的平均值]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/99858216</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/99858216</guid><author>Wangdanting123</author><pubDate>Tue, 20 Aug 2019 16:40:21 +0800</pubDate><description><![CDATA[/**
 * 计算array的平均值
 * Computes the mean of the values in `array`
 * @param {Array} array The array to iterate over
 * @returns {number} Returns the mean
 * @example
 * mean([4, 2, 8, 6])
 * // =&gt; ...]]></description><category></category></item><item><title><![CDATA[计算数组中的最大值，如果数组是空的或者是非数组则返回undefined]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/99851629</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/99851629</guid><author>Wangdanting123</author><pubDate>Tue, 20 Aug 2019 15:46:28 +0800</pubDate><description><![CDATA[/**
 * 计算array中的最大值，如果array是空的或者是非数组则返回undefined
 * computes the maximum value of `array`. If `array` is empty or falsey
 * `undefined` is returned.
 * @param {Array} array The array to iterate over
...]]></description><category></category></item><item><title><![CDATA[根据precision(精度)向上舍入number]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/99741893</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/99741893</guid><author>Wangdanting123</author><pubDate>Mon, 19 Aug 2019 17:34:14 +0800</pubDate><description><![CDATA[/**
 * 根据precision(精度)向上舍入number。(precision(精度)可以理解为保留几位小数)
 * Computes `number` rounded up to `precision`
 * @param {number} number The number to round up
 * @param {number} [precision=0] The precis...]]></description><category></category></item><item><title><![CDATA[两个数相加]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/99729373</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/99729373</guid><author>Wangdanting123</author><pubDate>Mon, 19 Aug 2019 15:11:44 +0800</pubDate><description><![CDATA[/**
 * Adds two numbers
 * 两个数相加
 * @param {number} augend The first number in an addition
 * @param {number} addend The second number in an addition
 * @returns {number} Returns the total
 * @exampl...]]></description><category></category></item><item><title><![CDATA[产生一个包括lower与upper之间的数]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/99715085</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/99715085</guid><author>Wangdanting123</author><pubDate>Mon, 19 Aug 2019 10:37:29 +0800</pubDate><description><![CDATA[/**
 * 产生一个包括lower与upper之间的数，如果只提供一个参数返回一个0到提供数之间的数，
 * 如果floating设为true,或者lower或upper是浮点数，结果返回浮点数
 * @param {number} [lower=0] The lower bound
 * @param {number} [upper=1] The upper bound
 * @param ...]]></description><category></category></item><item><title><![CDATA[检查数值是否在start与end之间，但不包括end]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/98890318</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/98890318</guid><author>Wangdanting123</author><pubDate>Thu, 08 Aug 2019 22:22:28 +0800</pubDate><description><![CDATA[/**
 * 检查n是否在start与end之间，但不包括end。如果end没有指定，那么start设置为0，
 * 如果start大于end,那么参数会交换以便支持负范围。
 * Checks if `n` is between `start` and up to, but not including, `end`.
 * If `end` is not specified, it's set...]]></description><category></category></item><item><title><![CDATA[重复N次给定字符串]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/98480197</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/98480197</guid><author>Wangdanting123</author><pubDate>Tue, 06 Aug 2019 11:18:16 +0800</pubDate><description><![CDATA[/**
 * 重复N次给定字符串
 * Repeats the given string `n` times
 * @param {string} [string=''] The string to repeat
 * @param {number} [n=1] The number of times to repeat the string
 * @returns {string} Retur...]]></description><category></category></item><item><title><![CDATA[转义字符串中的'&', '&lt;', '&gt;', '"', "'", "`" 字符为HTML实体字符]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/98379889</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/98379889</guid><author>Wangdanting123</author><pubDate>Tue, 06 Aug 2019 11:17:44 +0800</pubDate><description><![CDATA[/**
 * 转义字符串中的'&amp;', '&lt;', '&gt;', '"', "'", "`" 字符为HTML实体字符
 * **注意：** 不会转义其他字符
 * Converts the characters '&amp;', '&lt;', '&gt;', '"', "'", "`" in `string` to their corresponding HTML entities...]]></description><category></category></item><item><title><![CDATA[替换字符串中匹配的字符为给定的替代字符]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/98597812</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/98597812</guid><author>Wangdanting123</author><pubDate>Tue, 06 Aug 2019 11:16:37 +0800</pubDate><description><![CDATA[/**
 * 替换string字符串中匹配的pattern为给定的replacement
 * Replaces matches for `pattern` in `string` with `replacement`
 * @param {string} [string=''] The string to modify
 * @param {RegExp|string} pattern The...]]></description><category></category></item><item><title><![CDATA[如果字符串长度小于length则从左侧和右侧填充字符，如果没法平均分配，则截断超出的长度]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/98531421</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/98531421</guid><author>Wangdanting123</author><pubDate>Mon, 05 Aug 2019 22:59:30 +0800</pubDate><description><![CDATA[/**
 * 如果string字符串长度小于length则从左侧和右侧填充字符，如果没法平均分配，则截断超出的长度
 * Pads `string` on the left and right sides if it's shorter than `length`.
 * Padding characters are truncated if they can't be evenly divid...]]></description><category></category></item><item><title><![CDATA[转换字符串以空格分开单词，并转为小写]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/98476447</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/98476447</guid><author>Wangdanting123</author><pubDate>Sun, 04 Aug 2019 23:53:50 +0800</pubDate><description><![CDATA[/**
 * 转换字符串以空格分开单词，并转为小写
 * Converts `string`, as space separated words, to lower case
 * @param {string} [string=''] The string to convert
 * @returns {string} Returns the lower cased string
 * @ex...]]></description><category></category></item><item><title><![CDATA[转换字符串为中滑线连接格式]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/98397230</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/98397230</guid><author>Wangdanting123</author><pubDate>Sun, 04 Aug 2019 00:02:28 +0800</pubDate><description><![CDATA[/**
 * 转换字符串为中滑线连接格式
 * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles)
 * @param {string} [string=''] The string to convert
 * @returns {string} Retu...]]></description><category></category></item><item><title><![CDATA[转义RegExp字符串中特殊的字符"^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", "|"]]></title><link>https://blog.youkuaiyun.com/Wangdanting123/article/details/98384350</link><guid>https://blog.youkuaiyun.com/Wangdanting123/article/details/98384350</guid><author>Wangdanting123</author><pubDate>Sat, 03 Aug 2019 22:02:03 +0800</pubDate><description><![CDATA[/**
 * 转义RegExp字符串中特殊的字符"^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", "|"
 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
 * "?", "(", ")", "[", "]", "{", ...]]></description><category></category></item></channel></rss>