声明变量,一定要用 var!
2016-11-22 03:17
176 查看
public static T TryGet<T>(Func<T> func, T ifError = default(T)) { try { return func(); } catch { return ifError; } }
string a;
try{ a = doooooooooo(); } catch { a = "wrewre"; }
//this is shit!
var a = TryGet(doooooooooo, "wrewre");
//great!
相关文章推荐
- 浅谈JavaScript中定义变量时有无var声明的区别
- javascript中var let const三种变量声明方式
- 不同域(全局,局部)var变量声明的问题
- javascript var声明变量提升
- 为什么JavaScript声明变量的时候鼓励加var关键字
- JavaScript中变量声明有var和没var的区别示例介绍
- 在函数内部定义的变量加与不加var的区别,匿名函数和有名函数内声明变量的区别
- JavaScript中变量声明有var和没var的区别
- 函数内声明变量不加var和加var的区别
- JScript中的隐式变量声明和var变量声明
- Swift_声明变量var、常量let
- 用var分散声明变量会出错
- 详解变量声明加 var 和不加 var 的区别
- 变量不加 var 声明——掉进坑中,无法自拔!
- js中所有的变量声明var当被悬置到函数的顶部
- 使用delete删除var声明的变量
- angularJS2 变量声明 var let const
- 关于JavaScript中var声明变量作用域的推断
- JScript中的隐式变量声明和var变量声明
- js声明变量使用var声明与不使用var声明比较