数据透视表日期怎么选范围

by Tiffany White

蒂芙尼·怀特(Tiffany White)

透视范围 (Putting Scope in Perspective)

In JavaScript, lexical scope deals with where your variables are defined, and how they will be accessible — or not accessible — to the rest of your code.

在JavaScript中, 词法作用域处理变量的定义位置以及其余代码如何访问(或不可访问)它们。

There are two terms to think about when talking about scope: local and global. These two terms are important to understand, because one can be more dangerous than the other when declaring variables and executing your code.

在讨论范围时,要考虑两个术语:本地和全局。 理解这两个术语很重要,因为在声明变量和执行代码时,一个术语可能比另一个更为危险。

全球范围 (Global Scope)

A variable is globally scoped if you declare it outside of all of your functions. For example:

如果在所有函数之外声明变量,则该变量在全局范围内。 例如:

//global variable, i.e. global scopevar a = "foo";
function myFunction() {  var b = "bar";  console.log(a+b);}
myFunction();

When a variable is in the global scope, it can be accessed by all the code in the same JavaScript file. In this example, I’m accessing the variable a in my console.log statement, inside the myFunction function.

当变量在全局范围内时,同一JavaScript文件中的所有代码都可以访问该变量。 在此示例中,我myFunction函数内的console.log语句中访问变量a

当地范围 (Local Scope)

Local variables only exist inside functions. They are scoped to that individual function.

局部变量仅存在于函数内部。 它们仅限于该单独功能。

You can think of local variables as as any variables that fall between an opening and closing curly brace.

您可以将局部变量视为位于花括号之间的任何变量。

These local variables can’t be accessed by code outside of the function to which they belong.

这些局部变量不能由其所属函数外部的代码访问。

Take a look at this code:

看一下这段代码:

//global variable, i.e. global scopevar a = "foo";
function myFunction() {  //local variable, or local scope  var b = "bar";  console.log(a+b);}
function yourFunction() {  var c = "JavaScript is fun!";  return c;  console.log(c);}
myFunction();yourFunction();

Notice how the variables are each declared inside separate functions. They are both local variables, in local scope, and can’t be accessed by one other.

请注意,如何分别在单独的函数中声明变量。 它们都是局部变量,在局部范围内,不能彼此访问。

For instance, I can’t return b in yourFunction, because b belongs to myFunction. b can’t be accessed by yourFunction, and vice versa.

例如,我不能在yourFunction中返回b 因为b属于myFunction。 b无法通过yourFunction访问反之亦然。

If I were to try to return the value of b when calling yourFunction, I’d get “error: b is not defined.” Why? Because b doesn’t belong to yourFunction. b is outside of yourFunction’s scope.

如果在调用yourFunction时尝试返回b的值, 则会收到“ 错误:b未定义。 为什么? 因为b不属于yourFunction。 b在您的功能范围之外。

When adding nested conditionals, scope gets even more hairy. But I’ll leave that for another time.

当添加嵌套条件时,作用域变得更加毛茸茸。 但我会再等一遍。

But for now, remember the difference between global scope and local scope. And the next time you get a “is not defined” error, check the variable’s scope.

但是现在,请记住全局范围和本地范围之间的区别。 下次您遇到“ 未定义 ”错误时,请检查变量的范围。

This post also appears at https://twhite96.github.io

这篇文章也出现在https://twhite96.github.io

翻译自: https://www.freecodecamp.org/news/putting-scope-in-perspective-c9a16974c3be/

数据透视表日期怎么选范围

数据透视表日期怎么选范围_透视范围相关推荐

  1. 数据透视表日期怎么选范围_筛选数据透视表中的日期范围

    数据透视表日期怎么选范围 In a pivot table, you might want to see all the orders that were shipped on a specific ...

  2. Excel 透视表 - 人生第一个简单的透视表

    Q: 什么是透视表呢? 数据透视表(Pivot Table)是一种交互式的表,可以进行某些计算,如求和与计数等.所进行的计算与数据跟数据透视表中的排列有关. 之所以称为数据透视表,是因为可以动态地改变 ...

  3. java自动生成生成java透视表_java基于poi导出excel透视表代码实例

    这篇文章主要介绍了java基于poi导出excel透视表代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 从前,我是一个前端程序猿,怀着对打通 ...

  4. 数据透视表里填充重复项_数据透视表填充颜色消失

    数据透视表里填充重复项 Microsoft just announced the winner of their Excel World Champ data visualization contes ...

  5. 怎样通过vb设置透视表多项选择_数据透视表有多强大?

    谢邀,我觉得数据透视表最强大之处就是做数据看板. 因为做完数据看板后,点来点去感觉实在太爽了!重点是以后只需要简单替换数据源就能达到更新报表,一劳永逸!首先我们来看一下它的效果吧! 自动化数据看板有多 ...

  6. 多设备同步表数据_利用Excel数据透视表解决两份报表数据不同步问题

    19年元旦已经接近尾声啦,各位小伙伴们这个元旦假期过得快乐么,都去哪里玩了?屠夫的元旦假期一直都在加班,直到现在才有时间来分享Excel应用方面的一些经验和心得. 想必各位都有过这样的经历吧,人力资源 ...

  7. js固定表格行列_纯前端表格控件SpreadJS V14.0发布:组件化编辑器+数据透视表

    SpreadJS 是一款基于 HTML5 的纯前端表格控件,兼容 450 种以上的 Excel 公式,具备"高性能.跨平台.与 Excel 高度兼容"的产品特性,可为用户提供高度类 ...

  8. 怎样通过vb设置透视表多项选择_四个操作带你玩转数据透视表,秒杀Excel函数,提升你的工作效率...

    相信很多朋友都会用Excel做的一个事情,那就是进行各类数据的统计.比如各部门数据的汇总求和.求平均.求个数及占比等.用到的基本都有sum.average.countif等计算函数.实际操作中,有一种 ...

  9. autojs遍历当前页面所有控件_纯前端表格控件SpreadJS V14.0发布:组件化编辑器+数据透视表 - 葡萄城开发工具...

    SpreadJS 是一款基于 HTML5 的纯前端表格控件,兼容 450 种以上的 Excel 公式,具备"高性能.跨平台.与 Excel 高度兼容"的产品特性,可为用户提供高度类 ...

最新文章

  1. CRMEB系统使用协议
  2. 深度学习原理与框架-卷积网络细节-数据增强策略 1.翻转 2.随机裁剪 3.平移 4.旋转角度...
  3. [luoguP1849] [USACO12MAR]拖拉机Tractor(spfa)
  4. UVA 125 Numbering Paths
  5. android如何适配平板,适用于平板电脑、大屏设备和可折叠设备的自适应布局
  6. php中msubstr,PHP学习:thinkphp中字符截取函数msubstr()用法分析
  7. java 反射 内存_Java 反射
  8. 优化反射性能的总结(上)
  9. 新的实现上下文对话的方法
  10. 外呼机器人起名_电销外呼机器人如此受欢迎,今天终于知道原因了
  11. [裴礼文数学分析中的典型问题与方法习题参考解答]4.3.11
  12. 区块链项目开发最容易受区块链技术影响的行业
  13. 利用消息机制实现.NET AOP(面向方面编程)--基本概念和实现
  14. 成功解决Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings
  15. 小程序支付:appid和mch_id不匹配采坑实录
  16. Hdl_localization全套安装运行问题总结
  17. 【阿里内推一面】记我人生中的处女面
  18. 中国科学院大学毕业典礼致辞全文
  19. win10 任务栏上的工具栏,重启消失的解决方法
  20. java编程之伪静态(urlrewrite)

热门文章

  1. 长短期记忆网络LSTM
  2. win10进入不了系统修复方法
  3. MATLAB识别实验,Matlab在图像处理与目标识别方面的应用实验
  4. 或是独体字吗_独体字结构 独体结构的字有哪些字?
  5. matlab cdf 曲线不平滑,拟合经验CDF曲线以找到确切的值
  6. 使用git命令导出项目_git自动生成changelog及项目版本管理
  7. SQLyog连接linux数据库问题
  8. MATLAB数值取整
  9. Python3 matplotlib+numpy画函数图像
  10. 硕士论文如何通过查重?