         case let .value(value):
             return value.jsonString
         case let .function(f):
-            let funcName = "\(FunctionPrefix)\(JsCache.allJsStrings().count)"
-            JsCache.add("var \(funcName) = \(f);")
-            return funcName.jsonString
+            return obtainFunctionJsonString(javascript: f)
         case let .point(point):
             return point.jsonString
         }

public protocol FunctionOrOthers: Jsonable {
}

public enum FunctionOrFloat: FunctionOrOthers {
    case value(Float)
    case function(String)

        case let .value(value):
            return value.jsonString
        case let .function(f):
            return obtainFunctionJsonString(javascript: f)
        }
    }
}
