How to work with Variable -Google apps script in tamil - Tutorial No.7
Quote from admin on October 28, 2023, 3:00 amWhat is variable :
In computer programming and mathematics, a variable is a fundamental concept that represents a named storage location in memory where data can be stored and manipulated. Variables are used to store different types of information, such as numbers, text, or complex data structures. They are essential for writing programs, performing calculations, and managing data.
var x;
var y= "sithtamil"
function variable{logger.log(y) var y= "sith" logger.log(y)
var a=2; var b=5; var c=a*b; logger.log(c) logger.log(typeof a)}
function variable2{ logger.log(typeof a)}
function variable3{const phi=3.14 logger.log(phi) phi=3.14}
Type of Variables
In JavaScript, you can assign a variable using the var, let, or const keywords followed by the variable name, an equal sign (=), and the value you want to assign. The choice of which keyword to use depends on the scope and mutability requirements of the variable:
var (Function-Scoped):Variables declared with var are function-scoped, meaning they are accessible within the function in which they are defined. They are hoisted to the top of their containing function or global scope, so you can access them even before they are declared.
var x = 10;
let (Block-Scoped): Variables declared with let are block-scoped, meaning they are accessible within the block (enclosed by curly braces {}) in which they are defined. This includes loops, conditionals, and functions. They are not hoisted to the top of their containing block.
let y = 20;
const (Block-Scoped, Immutable): Variables declared with const are also block-scoped. They are used for declaring constants, which means their values cannot be reassigned after initialization.
const pi = 3.14;
Function tutorial1() {
Logger.log("sithtamil & sithtamil!");
var app = SpreadsheetApp;
var ss= app.getActiveSpreadsheet();
var activesheet=ss.getActiveSheet();
activesheet.getRange("D2:F8").setValue("sith!");
activesheet.getRange(6,2).setValue("tamil!");
activesheet.getRange(2,2,3).setValue("sithtamil");
activesheet.getRange(2,2,3,4).setValue("sithtamil***");
var tempText = activesheet.getRange(4,1).getValue();
activesheet.getRange(6,2).setValue(tempText);
}
What is variable :
In computer programming and mathematics, a variable is a fundamental concept that represents a named storage location in memory where data can be stored and manipulated. Variables are used to store different types of information, such as numbers, text, or complex data structures. They are essential for writing programs, performing calculations, and managing data.
var x;
var y= "sithtamil"
function variable{logger.log(y) var y= "sith" logger.log(y)
var a=2; var b=5; var c=a*b; logger.log(c) logger.log(typeof a)}
function variable2{ logger.log(typeof a)}
function variable3{const phi=3.14 logger.log(phi) phi=3.14}
Type of Variables
In JavaScript, you can assign a variable using the var, let, or const keywords followed by the variable name, an equal sign (=), and the value you want to assign. The choice of which keyword to use depends on the scope and mutability requirements of the variable:
var (Function-Scoped):Variables declared with var are function-scoped, meaning they are accessible within the function in which they are defined. They are hoisted to the top of their containing function or global scope, so you can access them even before they are declared.
var x = 10;
let (Block-Scoped): Variables declared with let are block-scoped, meaning they are accessible within the block (enclosed by curly braces {}) in which they are defined. This includes loops, conditionals, and functions. They are not hoisted to the top of their containing block.
let y = 20;
const (Block-Scoped, Immutable): Variables declared with const are also block-scoped. They are used for declaring constants, which means their values cannot be reassigned after initialization.
const pi = 3.14;
Function tutorial1() {
Logger.log("sithtamil & sithtamil!");
var app = SpreadsheetApp;
var ss= app.getActiveSpreadsheet();
var activesheet=ss.getActiveSheet();
activesheet.getRange("D2:F8").setValue("sith!");
activesheet.getRange(6,2).setValue("tamil!");
activesheet.getRange(2,2,3).setValue("sithtamil");
activesheet.getRange(2,2,3,4).setValue("sithtamil***");
var tempText = activesheet.getRange(4,1).getValue();
activesheet.getRange(6,2).setValue(tempText);
}