如何将JavaScript的奇巧淫技巧妙地应用于长尾关键词优化?

2026-04-06 11:301阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计466个文字,预计阅读时间需要2分钟。

如何将JavaScript的奇巧淫技巧妙地应用于长尾关键词优化?

Kinky.htm JavaScript 技巧,JavaScript 技巧,评级组件,★★★★★.slice(5 - rate, 10 - rate); // 定义变量 rate 是 1 到 5 的值,输出单词 [[ ]] [[ ]] [[ !(~[]) {} [[ ~[]]]*~[]]~

如何将JavaScript的奇巧淫技巧妙地应用于长尾关键词优化?

kinky.htm

所有元素边框加色

[].forEach.call($$("*"), a => {a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})

随机字符串

Math.random().toString(16).substring(2) // 13位 Math.random().toString(36).substring(2) // 11位

匿名函数自执行

(function(){}()); (function(){})(); [function(){}()]; ~function(){}(); !function(){}(); +function(){}(); -function(){}(); delete function(){}(); typeof function(){}(); void function(){}(); new function(){}(); new function(){}; var f = function(){}(); 1, function(){}(); 1 ^ function(){}(); 1 > function(){}(); // ...

取整

~~2.33 2.33 | 0 2.33 >> 0

货币格式化 1,234,567,890

'1234567890'.replace(/\B(?=(\d{3})+(?!\d))/g, ',')

'1234567890'.split('').reverse().reduce((prev, next, index) => (index % 3 ? next : next + ',') + prev)

两个整数交换数值

var a=1,b=2; a += b; b = a - b; a -= b; // 缺点也很明显,整型数据溢出,对于32位字符最大表示数字是2147483647

a ^= b; b ^= a; a ^= b; // 位操作

数组特性

[...new Set([1, "1", 2, 1, 1, 3])] // 去重

Array(6).fill(8) // 重复数组

var numbers = [5, 458 , 120 , -215 , 228 , 400 , 122205, -85411]; Math.max.apply(Math, numbers) Math.max(...numbers) // 数组最大值

Array.prototype.slice.call(arguments) Array.from(arguments) // 将argruments对象转换成数组

一个数组中找到一个数 find([0,1,2,3,4,5], 2) function find (x, y) { for (let i = 0; i < x.length; i++) if (x[i] == y) return i; }

const find = (g => g(g)) (f => (next => (x, y, i = 0) => i >= x.length ? null : x[i] == y ? i : next(x, y, i+1))((...args) => f(f)(...args)))

数字运算

parseInt(0.0000008) // 8

0.1 + 0.2 // 0.30000000000000004, 使用 ES6 的 Number.EPSILON 来更正

参考

  1. github.com/jawil/blog/issues/24
  2. en.wikipedia.org/wiki/JSFuck
  3. esolangs.org/wiki/JSFuck
  4. patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html
  5. raw.githubusercontent.com/aemkei/jsfuck/master/jsfuck.js

本文共计466个文字,预计阅读时间需要2分钟。

如何将JavaScript的奇巧淫技巧妙地应用于长尾关键词优化?

Kinky.htm JavaScript 技巧,JavaScript 技巧,评级组件,★★★★★.slice(5 - rate, 10 - rate); // 定义变量 rate 是 1 到 5 的值,输出单词 [[ ]] [[ ]] [[ !(~[]) {} [[ ~[]]]*~[]]~

如何将JavaScript的奇巧淫技巧妙地应用于长尾关键词优化?

kinky.htm

所有元素边框加色

[].forEach.call($$("*"), a => {a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})

随机字符串

Math.random().toString(16).substring(2) // 13位 Math.random().toString(36).substring(2) // 11位

匿名函数自执行

(function(){}()); (function(){})(); [function(){}()]; ~function(){}(); !function(){}(); +function(){}(); -function(){}(); delete function(){}(); typeof function(){}(); void function(){}(); new function(){}(); new function(){}; var f = function(){}(); 1, function(){}(); 1 ^ function(){}(); 1 > function(){}(); // ...

取整

~~2.33 2.33 | 0 2.33 >> 0

货币格式化 1,234,567,890

'1234567890'.replace(/\B(?=(\d{3})+(?!\d))/g, ',')

'1234567890'.split('').reverse().reduce((prev, next, index) => (index % 3 ? next : next + ',') + prev)

两个整数交换数值

var a=1,b=2; a += b; b = a - b; a -= b; // 缺点也很明显,整型数据溢出,对于32位字符最大表示数字是2147483647

a ^= b; b ^= a; a ^= b; // 位操作

数组特性

[...new Set([1, "1", 2, 1, 1, 3])] // 去重

Array(6).fill(8) // 重复数组

var numbers = [5, 458 , 120 , -215 , 228 , 400 , 122205, -85411]; Math.max.apply(Math, numbers) Math.max(...numbers) // 数组最大值

Array.prototype.slice.call(arguments) Array.from(arguments) // 将argruments对象转换成数组

一个数组中找到一个数 find([0,1,2,3,4,5], 2) function find (x, y) { for (let i = 0; i < x.length; i++) if (x[i] == y) return i; }

const find = (g => g(g)) (f => (next => (x, y, i = 0) => i >= x.length ? null : x[i] == y ? i : next(x, y, i+1))((...args) => f(f)(...args)))

数字运算

parseInt(0.0000008) // 8

0.1 + 0.2 // 0.30000000000000004, 使用 ES6 的 Number.EPSILON 来更正

参考

  1. github.com/jawil/blog/issues/24
  2. en.wikipedia.org/wiki/JSFuck
  3. esolangs.org/wiki/JSFuck
  4. patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html
  5. raw.githubusercontent.com/aemkei/jsfuck/master/jsfuck.js