Stay organized with collections
Save and categorize content based on your preferences.
blockly > Names > (constructor)
Names.(constructor)
Constructs a new instance of the Names
class
Signature:
constructor(reservedWordsList: string, opt_variablePrefix?: string);
Parameters
Parameter |
Type |
Description |
reservedWordsList |
string |
A comma-separated string of words that are illegal for use as names in a language (e.g. 'new,if,this,...'). |
opt_variablePrefix |
string |
(Optional) Some languages need a '$' or a namespace before all variable names (but not procedure names). |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[],["The `Names` class constructor creates a new instance. It takes two parameters: `reservedWordsList`, a comma-separated string of illegal words, and `opt_variablePrefix`, an optional string for languages needing a prefix for variable names. The constructor initializes the class with these reserved words and optional prefix to manage and validate names.\n"]]