We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
////// 纯代码库: lib/params.js /////// // url :: IO String var url = new IO(function() { return window.location.href; }); // toPairs = String -> [[String]] var toPairs = compose(map(split('=')), split('&')); // params :: String -> [[String]] var params = compose(toPairs, last, split('?')); // findParam :: String -> IO Maybe [String] var findParam = function(key) { return map(compose(Maybe.of, filter(compose(eq(key), head)), p arams), url); }; ////// 非纯调用代码: main.js /////// // 调用 __value() 来运行它! findParam("searchTerm").__value(); // Maybe(['searchTerm', 'wafflehouse'])
我这边输出结果是个二维数组
// Maybe([['searchTerm', 'wafflehouse']])
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我这边输出结果是个二维数组
The text was updated successfully, but these errors were encountered: