Trending February 2024 # Rules And Regulations For Const Keyword # Suggested March 2024 # Top 4 Popular

You are reading the article Rules And Regulations For Const Keyword updated in February 2024 on the website Achiashop.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested March 2024 Rules And Regulations For Const Keyword

Introduction to TypeScript const

TypeScript const is one of the ways of declaring variables. The keyword ‘const’ makes the variable a constant, which means the variable’s value can not be changed. There are many other ways of declaring variables using ‘let’, ‘var’, etc. As ‘var’ allows to declare variables the same as JavaScript, it has the same scoping rules as that in JavaScript. While the ‘let’ keyword was introduced in ES6 along with the ‘const’ keyword, ‘let’ declares block-scoped local variables initializing to a value optionally. But in some cases, we do not want to block scope but also want immutable variables. Hence, with this limitation in the ‘let’ keyword, we are using the ‘const’ keyword for immutable variables.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

Syntax:

Given below is the syntax of TypeScript const:

It is a normal variable declaration but with the keyword ‘const.

Rules and Regulations for const Keyword

Const variables make a variable constant and cannot be changed.

Before declaring a const variable, users should make sure that the variable would not be reset.

An immutable variable is an approach that gives fewer bugs.

Const keyword declares block-scoped variables with any constant value.

Const has the same scoping rules that of the ‘let’ keyword.

If the user knows before hand that the variable declaring will not be reassigned, then it would be better to declare using const keyword instead of let and var keyword.

Const declaration provides a read-only reference to the value, which does not mean the value the const keyword is holding is immutable but can not be reassigned.

Const keyword can not be accessed before initialization which results in Reference Error.

Const can not be redeclared, which throws an Uncaught Syntax Error.

Sample declaration of const variables:

const sample_emp = "Karthik"; Examples of TypeScript const

Given below are the examples of TypeScript const:

Example #1

TypeScript const declaration.

Code:

const sample_emp="Karthik"; console.log('here is the employee name', sample_emp);

Output:

So here, we are only declaring a const variable and initializing it to a string value.

Now, we will see various errors with these const declarations.

Example #2

TypeScript const, the const variable cannot be reassigned.

Code:

const Employee = { empName: "Karthik", empID: 10, empLob: "RCL" }; Employee = { empName: "Daniel", empID: 11, empLob: "INS" }; Employee.empName = "Saideep"; console.log('Employee Name: ', Employee.empName) Employee.empID = 14; console.log('Employee ID: ', Employee.empID) Employee.empLob = "IVS"; console.log('Employee Lob: ', Employee.empLob)

Output:

There will be no output as this code will give an Error as ‘Cannot assign to ‘Employee’ as it is a constant.’

Example #3

TypeScript const must be initialized.

Code:

const EmpName; const EmpId = 45; EmpId = 89;

Output:

Example #4

TypeScript const being a block-scoped variable.

Code:

const stuName = "Ravi Kumar"; if (true) { const stuName = "Ravi Kiran"; console.log('Student Name: ', stuName); }

Output:

The same const variable we are declaring and initializing with a new value, this does not give us any error as it is taken as a new variable and is only limited to the if block.

Example #5

TypeScript const for Deep immutability.

Code:

const student = { stuName: "Jaanu", stuId: 567, stuCtgry: "RCL" }; student.stuName = "Jahnavi" student.stuId = 345 student.stuCtgry = "INS" console.log('Student Name', student.stuName); console.log('Student ID', student.stuId); console.log('Student Category', student.stuCtgry);

Output:

So here we see that student const has object literals, and we are reassigning the object literals and not the const value. Hence const keyword supports sub-properties of objects to be mutated.

Example #6

TypeScript const Read-only reference to a value.

const student = { stuid:101, stuname:"Tushar"} student = {stuid:102, stuname:"Ramkiran"} console.log('here are the student details', student.stuid, student.stuname);

Output:

Here we will not get an output as the above code gives us an Error ‘Cannot assign to ‘student’ because it is a constant.’

The const here creates a Read-Only Reference to the value. The user can not change the reference as it is immutable. But user can change the value of the properties the const holds. The user can not assign a new object but can change the properties of the object.

Example #7

TypeScript const ‘Accessing before a declaration’.

Code:

console.log(Fruits); const Fruits  = { fruitName1: "Orange", fruitName2: "Apple", fruitName3: "Grapes" }; console.log('Fruits', Fruits);

Output:

There will be no output as the above code will give an error as ‘Variable ‘Fruits’ is used before assigning’ & ‘Block Scoped variable ‘Fruits’ used before its declaration’.

We are trying to access the const before initialization which results in Reference Error.

Conclusion

With this, we shall conclude our topic ‘TypeScript const’. We have seen what is TypeScript const and how is it used. Looked into its syntax declaration and initialization with few examples. Most of the Errors we face with this small keyword ‘const’ are also shown. Most of the developers recommend using const to declare variables. Const is mostly for block-scoped variables and immutable variables. We have also listed out few rules for TypeScript const on the declaration, its usage and its limitations. Only references are immutable for const objects.

Recommended Articles

We hope that this EDUCBA information on “TypeScript const” was beneficial to you. You can view EDUCBA’s recommended articles for more information.

You're reading Rules And Regulations For Const Keyword

10 Rules For Video Marketing & Seo Success

Video is one of, if not the most, influential communication mediums today.

It is predicted that by 2023, 80 percent of web traffic will be video. So it’s a no-brainer to try to incorporate video into your marketing strategy.

Understanding a few best practices, though, is fundamental in order to make your strategy a success.

Start at Square One

First, define your goals for video marketing, whether it’s to:

Drive conversions.

Increase backlinks.

Spread brand awareness.

Understanding your goals is a foundational key in order to figure out exactly what you want to gain out of video marketing.

Increasing Conversions

There have been studies by Eye View Digital that have found that using video can increase conversions by 80 percent.

The logic behind this is actually very simple when you think about it.

Users have to expend less effort watching a video clip than they do reading a large amount of text.

Video is a time saver for them.

Gaining Links & Social Shares

The link possibilities with video are powerful.

That is why it is important to create videos that are prime for social sharing, and thus backlinks.

What types of videos are likely to get shared? Videos that:

Entertain.

Provide a solution to a common problem.

Help educate on a hot topic.

The goal is that the content will be engaging enough, that users share it, generating backlinks and helping to increase overall authority of a website.

When it comes to the nitty-gritty practices that can help your video SEO efforts, there are a few trusted methods that can be implemented.

Let’s dive into 10 tried-and-true tactics for video marketing for search engines.

1. Mobile Optimization

Mobile optimization is clearly not only a part of video optimization; mobile optimization is the primary focus of web optimization today.

Mobile surpassed desktop views a few years ago, and only continues to grow.

In addition, a large portion of video consumption is on mobile devices.

Ensure that your website is responsive and that you are uploading videos to sites like YouTube and Vimeo.

2. Metadata

Just like you would optimize a page on a website with a fitting meta title and meta description, ensure that you have done the same for a video.

Search engines will use this to identify and rank video results.

Search engines will assess the title, description, as well as tags (which should include targeted keywords) to better understand what the topic of the video is.

This is simple to do and requires little time.

3. Create a Video Sitemap

If you create a large amount of video content and publish those videos to your website, but are finding it challenging to rank for them, you may want to create a separate video sitemap.

This sitemap will help to give Google a better idea of what pages have videos, and the general content focus of the video.

4. Share Across Various Channels

Share video content across various marketing channels, such as social.

Upload video content to Facebook, YouTube, or Instagram and see what types of posts garner the most engagement.

Adding video to your social channels will also help encourage social sharing, thus encouraging a greater amount of backlinks that can make your site more authoritative in Google’s eyes.

5. Add the Video to Your Website

Adding video content to your site, and not only to sites like YouTube and Vimeo, can help increase engagement and user experience on your site.

As mentioned earlier, video content tends to be more engaging.

You can also add things like video schema to your page to help crawlers further understand what the video content is covering.

6. Transcribe the Video

Search engine crawlers can’t actually watch video content – at least not yet.

Video transcriptions help to provide these crawlers with an idea of what a video is about, thus giving them a better understanding of the content.

7. Create an Engaging Thumbnail

Users have a large pool of options when it comes to deciding which video to select from search.

A video thumbnail is likely the first thing that they will see in those results. This is why it is important to ensure that the thumbnail can stand out from the others in the best way possible and grab a user’s attention.

Generally, you can choose a thumbnail from the video itself or upload a separate image. Make sure that image reflects the topic of the video well.

8. Video Filename

This may be the most simplistic optimization tactic. Name video files on your computer the same way you would image files. Include a targeted keyword or accurate description about the topic of the video.

9. Keep Length in Mind

This will vary based on industry and topic, but it is important to keep duration in mind. Our attention spans in this digital age are not incredibly long whatsoever.

That being said, if you are creating educational content (e.g., a tutorial), then it would make sense for the video to be longer in duration.

However, if you’re creating an entertaining promotional video, you may want to keep it short, including the most important aspects earlier on in order to entice the user to engage with the content.

10. Encourage Likes & Comments

These are among some of the most important factors when it comes to engagement.

Don’t Lose Focus on the Whole Picture

While all these practices are well and good for essential video optimization techniques, it is important to not get so caught up in the nitty gritty of tags, titles, etc. that you lose focus on your actual goal and what the primary purpose of the video is.

A video can have an optimized title, tags, a video sitemap, an apt thumbnail, and whatnot.

But if your video doesn’t entertain, educate, or help a user, is it really a success?

There’s no telling how many times a video has a catchy title and a description, but the actual video quality is subpar, the graphics don’t speak to the primary topic, or the general message is unclear.

This is not a positive experience.

The job of a true digital marketer is to provide a solution to a person’s problem.

This is why the content of the video is crucial.

From the actual message itself, to how that message is conveyed, these are all paramount factors.

There are many things to consider when determining video content strategy for marketing efforts. A few prominent ones include:

Personas: It is important to establish key user personas for your intended target audience. This helps to determine the overall tone that the video should take.

Stage of the journey: Along the same lines of targeting the ideal persona, you’ll also need to create video that targets the right stage of the user’s journey and where they are at in the funnel. For example, video content for someone in the awareness stage may be a brief, how-to video or motivational video. Whereas content in the in the consideration phase may include testimonials and compelling CTAs.

Topics that suite video search: It is important, when trying to rank in video results, to understand what types of content, overall, rank well for video to help a user find your content. Video results notoriously rank well for “how to” or other research-based searches. Understanding the areas where video results are high can help provide insight and guidance for additional content strategy ideas.

Video can be an extremely powerful marketing tool if used in the right way.

By keeping a few technical best practices in mind while also maintaining a clear and concise outlook on the end goal, marketers have the potential to capture an ever-expanding group with their video messaging.

More Video Marketing Resources:

Search Outlook Email By Sender, Date, Keyword, Size And More

“Where’d my email go? It just disappeared.” It’s shocking how many times I’ve heard this over my career. But not as shocking as how many people who don’t realize that they can easily search for a specific email in Outlook. 

After reading this guide on how to search Outlook email by date, sender, keyword, and more, you’ll be able to find any email in Outlook too. We’re going to give you all the Outlook email search tips you can handle.

Table of Contents

Are Your Emails Indexed?

For the best email search results, let’s make sure Outlook has indexed everything. 

What’s indexing? Just like the index of a book has all the topics listed and where to find them, Outlook indexing creates a database like that. It’s easier for programs to search through a database than a bunch of freeform text.

If the number of items to be indexed is anything but zero, give it a few minutes. That will ensure that the search is as complete as possible.

Indexing does take some resources. If you find that it slows down Outlook or your computer too much, you can turn off indexing to get better computer performance.

Permanently Add Search Tab

Look for the Search Tools tab. Now we can access all the search tools easily anytime.

Set The Scope Of The Search

In the Search Tools tab, we can easily set the scope of the search. On the left side, we’ll see that we can set the scope to All Mailboxes, Current Mailbox, Current Folder, Subfolders, or All Outlook Items.

All Mailboxes – choose this scope if we have shared mailboxes or other accounts in Outlook. Some people may have both their work and personal email accounts in Outlook.

Current Mailbox – choose this scope to keep the search within just the one mailbox. Ensure that the mailbox is selected in the left pane of Outlook.

Current Folder – this scope will limit the search to the folder that is currently selected in the left pane of Outlook.

Subfolders – this limits the scope to the folders under whatever folder is selected in the left pane.

All Outlook Items – The most open scope will apply the search to all emails, contacts, calendar items, and tasks. Because of the large amount of data, searches on this scope can be slow and yield unnecessary results. Use this scope sparingly.

Search Operators In Outlook

Search results can be made more specific by using search operators. 

To find a specific phrase, put double quote marks around the search phrase.

Example: “TPS report”

To find items that must have two or more words in it, but not necessarily right next to each other or in the order written, use the AND operator.

Example: work AND weekend

To find items containing a keyword and exclude items that contain a different keyword, use the NOT operator.

Example: saturday NOT great

Looking for something that could have one word or another? Try the OR operator.

Example: giraffe OR product

All these operators can be combined to make the search as specific as we’d like. We could have something as complex as “TPS report” AND weekend OR giraffe NOT great.

Search Outlook By Keyword

The easiest search Outlook email is the keyword search. It’s most simply done from the Instant Search field at the top of our inbox.

Set the scope in the drop-down box next to the Instant Search field, or in the Search tab.

Type the keyword, or words, into the search field and tap the Enter key. The search operators can be used here to help make the search more specific.

Search Outlook By Sender

To search Outlook email by sender:

Remove Sender Name from between the double-quotes and type in the name of the person we’re looking for. We can also just type the whole term directly into the Instant Search. Tap the Enter key to search.

Search Outlook By Subject

To search Outlook email by subject: 

Replace keywords with the subject we’re looking for. The whole phrase can be typed into Instant Search too. Tap the Enter key to search.

Search Outlook By Date

To search Outlook emails by date:

Search Outlook For Items With Attachments

To search Outlook email by attachments:

Search Outlook By Category

Using the Category tool to organize emails is under-utilized. 

We can search by category using the Categorized button under the search tab. 

Search Outlook Email By Recipient

This is the way to search for emails based on who they were sent to. 

Delete the Recipient Name part and enter the name we’re looking for. Hit Enter to search.

Search By Read Or Not Read

You can search Outlook emails by whether they’ve been read or unread.

Search By Flagged

Using flags to mark important emails helps stay on top of things. 

Search By Importance

See only important emails in Outlook as follows.

Combining Search Options More Search Options

Mostly, it will put a drop-down menu under the search bar with the options that the specific search type supports.

chúng tôi

Advanced Search Options

We can access well over a hundred different search options going far beyond what we’ve covered. We might never use this, but it’s good to know it’s here. 

The Advanced Find window will open. 

Take some time and look around here. It’s overwhelming how much can be done. We can search based on any field of any Outlook item. There are a few hundred different things we can search on.

The Power Of Outlook Search

Aren’t you amazed at how extensive and powerful Outlook’s search capabilities are? Did you even know that was all possible? Most people probably never use a tenth of all the things that Outlook can do. Use this as a springboard into learning what else Outlook can do for you. 

You can create your own Outlook shortcuts for email tasks. Set up Outlook rules to organize email into folders. Or even schedule an email to be sent at a specific time! Having Outlook just read emails is a bit like using a Ferrari to get groceries.

Court Rules File Sharing Legal

Court Rules File Sharing Legal

A federal appeals court has upheld a controversial decision which ruled that file sharing software such as Kazaa, Morpheus or Grokster are indeed legal. The 9th U.S. Circuit Court of Appeals in Los Angeles ruled on Thursday that peer-to-peer software developers were not liable for any copyright infringement committed by people using their products, as long as they had no direct ability to stop the acts.

The Electronic Frontier Foundation argued on behalf of Streamcast, the creator of the Morpheus software. The Ninth Circuit decision is based in part on the fact that P2P networks have significant non-infringing uses, and that they can help artists earn money.

CNet reports that the ruling means that companies that write and distribute peer-to-peer software can’t be shut down because of the actions of their customers.

The court did not rule that peer-to-peer copyrighted file trading is legal, however, the decision answers questions of potential liability from defendants Grokster and StreamCast Networks, as well as from many of their rivals.

“The (record labels and movie studios) urge a re-examination of the law in the light of what they believe to be proper public policy,” the 9th U.S. Circuit Court of Appeals wrote. “Doubtless, taking that step would satisfy the copyright owners’ immediate economic aims. However, it would also alter general copyright law in profound ways with unknown ultimate consequences outside the present context.”

CNet reports:

Motion Picture Association of America CEO Jack Valenti said his group is reviewing its options and could appeal. He stressed that the court had not made the file trading of copyrighted works itself legal.

“Today’s decision should not be viewed as a green light for companies or individuals seeking to build businesses that prey on copyright holders’ intellectual property,” Valenti said in a statement. “Businesses that ignore their responsibilities as corporate citizens profoundly undermine innovation in both the creative and technological arenas.”

“Irrespective of what any court says, a debate has crystallized: it’s legitimate versus illegitimate,” said RIAA Chief Executive Officer Mitch Bainwol in a statement. “It’s whether or not digital music will be enjoyed in a fashion that supports the creative process or one that robs it of its future. That’s the online future of music.”

Copyright holders have been more successful in the past, forcing companies such as Napster, Audiogalaxy and Scour to shut down their file-trading networks.

Cbdc Vs Cryptocurrency: Top 10 Countries Enroute G20 Regulations

CBDC vs cryptocurrency: Experts are speculating as to which asset will rule the market in 2023

The Organization for Economic Co-operation and Development (OECD) has decided to work on regulating cryptocurrencies and all other forms of cryptocurrency assets. They are working on developing a framework by presenting the Crypto-Asset Reporting Framework (CARF), which is meant to automatically exchange information on cryptocurrency assets between various countries. India’s Presidency at G20 has once again raised hopes for the crypto industry in India. Over the past couple of years, India has been at the forefront of regulating digital currencies. Not just India, but several other countries have been planning on introducing CBDCs. Now experts speculate as to what kind of digital currencies will get more traction and attract investors. The battle between CBDC vs cryptocurrency is on! CBDCs are now becoming government favorites, apparently, these types of digital assets are quite easily manageable by government organizations, which is why more global governments are coming forward to introduce CBDCs, instead of cryptocurrency assets. Experts believe that after the release of G20 crypto regulations, more and more countries will come forward to adopt CBDC coins. Here, we have listed the top countries enroute G20 regulations that have already introduced CBDCs and will continue to adopt more rules in the future.

USA

For a long period of time, the Federal Reserve in the US did not give any clear direction for the launch of its digital currency. But the Biden government has taken several initiatives to uplift the condition of cryptocurrencies in the country. US’ government agencies have been working to develop their own frameworks and policy recommendations to address several priorities to control crypto scams. The US CBDC is expected to offer several facilities including fighting crimes.

India 

India is another major country that is working on regulating cryptocurrencies and has already introduced its CBDC. The Indian government is working on several methods that will prevent users from indulging too much in digital assets. Finance Minister, Nirmala Sitharaman has already stated that India’s digital rupee will boost the Indian economy in several ways and minimize the cost of currency management.

China

China is quite strict when it comes to using cryptocurrencies. The country has already banned digital assets and crypto mining, which led to several burgeoning crypto companies leaving the country and set up shops in more lenient and crypto-friendly countries. However, the Chinese government has opened up about its digital yuan that can be used across 23 major cities in the country, including Beijing, Shenzhen, and Shanghai, to name a few.

Russia

Russia is another country that has joined the growing list of governments focusing in CBDC development. Based on reports by the Bank of Russia, the country’s latest monetary policy will focus on connecting all banks and credit institutions to the double rouble platform in 2024.

South Korea

The Bank of Korea has recently completed its second phase of retail CBDC simulations. The digital won simulations proved successful in offering offline payments and cross border remittances, however, the developers are working on resolving a few performance issues with the blockchain technology.

Nigeria

Nigeria launched its CBDC in the fall of 2023, but not many Nigerians are interested to use the coin. Reports suggest less than 0.5% of Nigerians are using the CBDC. To put that in perspective, it seems like the people in Nigeria are more interested in using traditional cryptocurrencies, instead of the regulated cryptocurrencies.

Brazil

Brazil will supposedly launch a CBDC in 2024. Experts believe that this move can contribute to its status as an economic leader in South America. Survey suggests that as of this year, there are more than 30 million Brazilian citizens who have no access to traditional banking services, or credit or debit cards.

Bahama

The Bahamas has introduced Sand Dollar, a CBDC that is a direct liability to the country’s central bank and is backed by foreign reserves. The Sand Dollar was introduced in October 2023 and back then, it became the first government-backed money, legally under the obligation of the Central Bank of the Bahamas.

Thailand

The Central Bank of Thailand has been constantly pushing to develop retail CBDC to ensure that it offers additional benefits to the financial system with good risk management capabilities. As of now, the government is only working on successfully completing the pilot test of its Retail CBDC by the end of this year.

Australia

How To Use A Loop Keyword With Examples?

Introduction to Ansible Loop

Ansible loop is used to repeat any task or a part of code multiple times in an Ansible-playbook. It includes the creation of multiple users using the user module, installing multiple packages using apt or yum module or changing permissions on several files or folders using the file module. There are two keywords used in Ansible to create a loop:

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

loop

Syntax:

Flowchart

Let’s see the flowchart as given below:

How to Use Loop Keyword with Examples? Standard Loops

Iterating Over a Simple List

Iterating Over a List of Hashes

Iterating Over a Dictionary

1. Iterating Over a Simple List

We can use a simple list in a loop if we have a list of users, files, etc.

Code:

– file2

Output:

Code Explanation: In the above example, when we run the playbook, it will first pick “file” as input and replace the “item” keyword from the path, once file1 is deleted it will pick “file2” as input and delete “file2”.

Note: We can use touch state to create multiple empty files or change the timestamp and so If we have variables file or ‘vars’ section in our play, we can refer the name of the variables file for ‘vars’ section in the loop directly as below:

loop: “{{ list_of_files}}”

We can even pass the list directly to a parameter for some plugins like yum and apt etc. Sometimes passing the list to a parameter is better than using the loop.

2. Iterating Over a List of Hashes

Sometimes we have a situation like we have to add multiples users to different-different groups, not in a single group. In that case, we have a list of key-value pairs called hashes. We can iterate over a list of hashes using the loop as well.

Code:

– { name: ‘user2’, groups: ‘dbadmin’ }

Output:

Code Explanation: In the above example, we have two users and we want to add those two users in different groups. So we have mentioned user name as well as respective group and defined the name using a key in the task that is {{item.name}} and so on. The above playbook will add ‘user1’ to ‘SRE’ group and ‘user2’ to ‘dbadmin’.

3. Iterating Over a Dictionary

We can loop over a dictionary however we have to use dict2items Dict filter to turn a dictionary into a list of items.

Code:

when: item.value !=””

Output:

value: Cart

Complex Loops

Iterating Over Nested Lists

Retrying a Task until a Condition Is Met

Looping Over Inventory

1. Iterating Over Nested Lists

If we have a list that is a part of another list that becomes a nested list. We have to use Jinja2 expression to iterate over nested lists. Let’s understand it with an example if we have to add multiple users to multiple groups. In the below example, we have two users and both users have to be added to both the groups ‘sre’ and ‘dbadmin’.

Output:

2. Retrying a Task until a Condition is Met

In some scenarios, we have to stop the loop once a certain condition met. We use ‘until’ keyword to stop a loop as below:

delay: 1

Output:

Code Explanation: In the above example, the shell module will run until the return code of the shell module does not return 0 or the task has been retried 2 times with a delay of 1 sec. In the first snapshot, the play failed because rc is 1 because there is no file or folder with name test2 in the root folder but when ran the playbook after creating that folder in the root folder, it got passed. It totally depends upon the scenario. The default value is 3 times and 5 seconds for retries and delays respectively.

3. Looping Over Inventory

If we have items in an inventory and you want to iterate over that inventory or a subset of that inventory, we can use “groups” variable and if we want to iterate on items that are part of current play then we need to use ‘ansible_play_batch’ as shown below:

Code:

loop: “{{ ansible_play_batch }}”

Output:

Note: We can also use patterns to query inventory however it requires a special plugin called ‘inventory_hostnames’.

Adding Controls to Loops

Limit Loop Output

Pause a Loop

Track Progress of A Loop

1. Limiting Loop Output

If we want to limit the output of the Ansible-playbook which is generating a huge amount of output on the console, we can use ‘label’ directive with ‘loop_control’. For example, we have to create multiple servers with some standard configuration and ansible-playbook is going to output all details with its name however we want to keep our output clean and only interested in the name of the server to be displayed as a console output. Here is another example:

Code:

label: “{{ chúng tôi }}”

Code Explanation: We have an example that is used in the explanation of ‘Iterate over a list of hashes’ except added loop_control and you can see the difference as it is only showing users name, not the group name in the output.

2. Pause a Loop

In some scenarios, we have to give some time for the first command to complete before executing the next one. We use the ‘pause’ directive with loop_control. It is like using sleep in some programming language like PowerShell.

pause: 5

Output:

3. Track Progress of A Loop

If we want to curiously know how many items have been executed in a loop, we can use ‘index_var’ directive with ‘loop_control’.For example:

index_var: my_id

Output:

Conclusion – Ansible Loop Recommended Articles

This is a guide to Ansible Loop. Here we discuss the Introduction and how to use a loop keyword? along with different examples and its code implementation. You may also have a look at the following articles to learn more –

Update the detailed information about Rules And Regulations For Const Keyword on the Achiashop.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!