Function Reordering

Potency Low
Resilience High
Cost None
Tags: functions, reorder, scramble, obfuscation

Description

Function Reordering randomly reorders function declarations.

Code Annotation Example

// @jscrambler enable functionReordering

Example

The following example contains five function declarations and two function expressions:

function a () { /* body */ }
function b () { /* body */ }
function c () { /* body */ }
function d () { /* body */ }
function e () { /* body */ }
var f = function () { /* body */ }
var g = function () { /* body */ }

All function declarations have been reordered but the function expressions haven't:

function c () { /* body */ }
function e () { /* body */ }
var f = function () { /* body */ }
function b () { /* body */ }
function d () { /* body */ }
var g = function () { /* body */ }
function a () { /* body */ }

Browser Compatibility

Browser Compatible Versions Tested Versions Notes
Chrome 80+ 80+
Firefox 90+ 90+
Internet Explorer 8+ 8+
Microsoft Edge 116+ 116+
Safari 13.1+ 13.1+

API Parameters

Example:

{
  "keys": {
    "accessKey": "XXXXXX",
    "secretKey": "YYYYYY"
  },
  "applicationId": "ZZZZZZ",
  "params": [
    {
      "name": "functionReordering"
    }
  ]
}