{"id":209967,"date":"2023-10-04T00:10:29","date_gmt":"2023-10-04T00:10:29","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/"},"modified":"2023-10-04T00:10:29","modified_gmt":"2023-10-04T00:10:29","slug":"does-lua-pass-by-reference-or-value","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/","title":{"rendered":"Does lua pass by reference or value?"},"content":{"rendered":"<p>In Lua, the answer to whether it passes by reference or value can be a bit tricky, as it depends on what is being passed and how it is being used.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#Passing_by_value\" title=\"Passing by value\">Passing by value<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#Passing_by_reference\" title=\"Passing by reference\">Passing by reference<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#Example\" title=\"Example:\">Example:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#FAQs\" title=\"FAQs:\">FAQs:<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#1_Can_Lua_pass_primitive_types_like_integers_and_strings_by_reference\" title=\"1. Can Lua pass primitive types like integers and strings by reference?\">1. Can Lua pass primitive types like integers and strings by reference?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#2_Can_Lua_pass_arrays_by_reference\" title=\"2. Can Lua pass arrays by reference?\">2. Can Lua pass arrays by reference?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#3_How_can_I_pass_a_table_by_value_in_Lua\" title=\"3. How can I pass a table by value in Lua?\">3. How can I pass a table by value in Lua?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#4_Does_passing_by_reference_in_Lua_lead_to_memory_leaks\" title=\"4. Does passing by reference in Lua lead to memory leaks?\">4. Does passing by reference in Lua lead to memory leaks?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#5_Can_I_pass_functions_by_reference_in_Lua\" title=\"5. Can I pass functions by reference in Lua?\">5. Can I pass functions by reference in Lua?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#6_How_does_passing_by_reference_affect_performance_in_Lua\" title=\"6. How does passing by reference affect performance in Lua?\">6. How does passing by reference affect performance in Lua?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#7_Can_I_modify_a_table_passed_by_value_in_Lua\" title=\"7. Can I modify a table passed by value in Lua?\">7. Can I modify a table passed by value in Lua?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#8_Does_Lua_support_passing_variables_by_reference_with_pointers\" title=\"8. Does Lua support passing variables by reference with pointers?\">8. Does Lua support passing variables by reference with pointers?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#9_How_does_pass_by_reference_work_with_nested_tables_in_Lua\" title=\"9. How does pass by reference work with nested tables in Lua?\">9. How does pass by reference work with nested tables in Lua?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#10_What_are_the_implications_of_passing_tables_by_reference_in_Lua\" title=\"10. What are the implications of passing tables by reference in Lua?\">10. What are the implications of passing tables by reference in Lua?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#11_Can_I_avoid_passing_by_reference_in_Lua_to_prevent_unintended_side_effects\" title=\"11. Can I avoid passing by reference in Lua to prevent unintended side effects?\">11. Can I avoid passing by reference in Lua to prevent unintended side effects?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#12_Are_there_any_best_practices_for_passing_data_in_Lua_to_optimize_performance\" title=\"12. Are there any best practices for passing data in Lua to optimize performance?\">12. Are there any best practices for passing data in Lua to optimize performance?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Passing_by_value\"><\/span>Passing by value<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>When passing simple data types like numbers and strings to functions in Lua, they are passed by value. This means that the function receives a copy of the original value, and any changes made to it within the function do not affect the original value outside of it.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Passing_by_reference\"><\/span>Passing by reference<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>On the other hand, when passing complex data types like tables to functions in Lua, they are passed by reference. This means that the function receives a reference to the original table, and any changes made to it within the function will affect the original table outside of it.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Example\"><\/span>Example:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>&#8220;`lua<br \/>\nfunction modifyTable(tbl)<br \/>\n    tbl[&#8220;key&#8221;] = &#8220;new value&#8221;<br \/>\nend<\/p>\n<p>myTable = {key = &#8220;old value&#8221;}<br \/>\nmodifyTable(myTable)<\/p>\n<p>print(myTable[&#8220;key&#8221;]) &#8212; Output: new value<br \/>\n&#8220;`<\/p>\n<p>In the example above, `myTable` is passed by reference to the `modifyTable` function, so any changes made to it inside the function are reflected in the original table.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1_Can_Lua_pass_primitive_types_like_integers_and_strings_by_reference\"><\/span>1. Can Lua pass primitive types like integers and strings by reference?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No, primitive types like integers and strings are passed by value in Lua.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Can_Lua_pass_arrays_by_reference\"><\/span>2. Can Lua pass arrays by reference?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Arrays in Lua are represented by tables, so when passing an array (table) to a function, it is passed by reference.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_How_can_I_pass_a_table_by_value_in_Lua\"><\/span>3. How can I pass a table by value in Lua?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To pass a table by value in Lua, you can create a copy of the table using functions like `table.copy` or by manually iterating over the table and creating a new one.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_Does_passing_by_reference_in_Lua_lead_to_memory_leaks\"><\/span>4. Does passing by reference in Lua lead to memory leaks?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Passing by reference in Lua does not inherently lead to memory leaks. However, care must be taken when passing large tables by reference to avoid unexpected memory usage.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Can_I_pass_functions_by_reference_in_Lua\"><\/span>5. Can I pass functions by reference in Lua?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Functions in Lua are first-class citizens and can be passed as arguments to functions by reference.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_How_does_passing_by_reference_affect_performance_in_Lua\"><\/span>6. How does passing by reference affect performance in Lua?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Passing by reference in Lua can be more efficient than passing by value for complex data types like tables, as it avoids making unnecessary copies of data.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"7_Can_I_modify_a_table_passed_by_value_in_Lua\"><\/span>7. Can I modify a table passed by value in Lua?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If a table is passed to a function by value in Lua, any modifications made to it inside the function will not affect the original table outside of it.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"8_Does_Lua_support_passing_variables_by_reference_with_pointers\"><\/span>8. Does Lua support passing variables by reference with pointers?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Lua does not have native support for pointers like some other languages, so passing variables by reference in Lua is typically done using tables or functions.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"9_How_does_pass_by_reference_work_with_nested_tables_in_Lua\"><\/span>9. How does pass by reference work with nested tables in Lua?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>When a nested table is passed by reference to a function in Lua, any changes made to the nested table within the function will also affect the original nested table outside of it.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"10_What_are_the_implications_of_passing_tables_by_reference_in_Lua\"><\/span>10. What are the implications of passing tables by reference in Lua?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Since tables are passed by reference in Lua, changes made to a table within a function can have side effects on other parts of the program using the same table.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"11_Can_I_avoid_passing_by_reference_in_Lua_to_prevent_unintended_side_effects\"><\/span>11. Can I avoid passing by reference in Lua to prevent unintended side effects?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To avoid unintended side effects from passing tables by reference in Lua, you can make a copy of the table before passing it to a function that might modify it.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"12_Are_there_any_best_practices_for_passing_data_in_Lua_to_optimize_performance\"><\/span>12. Are there any best practices for passing data in Lua to optimize performance?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To optimize performance in Lua, consider passing complex data types like tables by reference, while passing primitive types like numbers and strings by value. Additionally, avoid unnecessary copying of data to reduce memory usage.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Lua, the answer to whether it passes by reference or value can be a bit tricky, as it depends on what is being passed and how it is being used. Passing by value When passing simple data types like numbers and strings to functions in Lua, they are passed by value. This means that &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Does lua pass by reference or value?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#more-209967\">Read more<span class=\"screen-reader-text\">Does lua pass by reference or value?<\/span><\/a><\/p>\n","protected":false},"author":53,"featured_media":107420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86279],"tags":[],"class_list":["post-209967","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Does lua pass by reference or value?<\/title>\n<meta name=\"description\" content=\"In Lua, the answer to whether it passes by reference or value can be a bit tricky, as it depends on what is being passed and how it is being used. Passing\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Does lua pass by reference or value?\" \/>\n<meta property=\"og:description\" content=\"In Lua, the answer to whether it passes by reference or value can be a bit tricky, as it depends on what is being passed and how it is being used. Passing\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/\" \/>\n<meta property=\"og:site_name\" content=\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/synchronyfinancial\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-04T00:10:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"164\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Chelsea Hooper\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@synchrony\" \/>\n<meta name=\"twitter:site\" content=\"@synchrony\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chelsea Hooper\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/\"},\"author\":{\"name\":\"Chelsea Hooper\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/cd57c4de58d2ceab0d743893b3d1cd1b\"},\"headline\":\"Does lua pass by reference or value?\",\"datePublished\":\"2023-10-04T00:10:29+00:00\",\"dateModified\":\"2023-10-04T00:10:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/\"},\"wordCount\":634,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"articleSection\":[\"Learn\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/\",\"name\":\"Does lua pass by reference or value?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2023-10-04T00:10:29+00:00\",\"dateModified\":\"2023-10-04T00:10:29+00:00\",\"description\":\"In Lua, the answer to whether it passes by reference or value can be a bit tricky, as it depends on what is being passed and how it is being used. Passing\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Does lua pass by reference or value?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"description\":\"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co\",\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/namso-gen.co\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"contentUrl\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"width\":500,\"height\":164,\"caption\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\"},\"image\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/synchronyfinancial\",\"https:\/\/twitter.com\/synchrony\",\"https:\/\/www.youtube.com\/synchronyfinancial\",\"https:\/\/www.instagram.com\/synchrony\",\"https:\/\/www.linkedin.com\/company\/synchrony-financial\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/cd57c4de58d2ceab0d743893b3d1cd1b\",\"name\":\"Chelsea Hooper\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"Chelsea Hooper\"},\"description\":\"Guest author Chelsea Hooper has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Does lua pass by reference or value?","description":"In Lua, the answer to whether it passes by reference or value can be a bit tricky, as it depends on what is being passed and how it is being used. Passing","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/","og_locale":"en_US","og_type":"article","og_title":"Does lua pass by reference or value?","og_description":"In Lua, the answer to whether it passes by reference or value can be a bit tricky, as it depends on what is being passed and how it is being used. Passing","og_url":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2023-10-04T00:10:29+00:00","og_image":[{"width":500,"height":164,"url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","type":"image\/png"}],"author":"Chelsea Hooper","twitter_card":"summary_large_image","twitter_creator":"@synchrony","twitter_site":"@synchrony","twitter_misc":{"Written by":"Chelsea Hooper","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/"},"author":{"name":"Chelsea Hooper","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/cd57c4de58d2ceab0d743893b3d1cd1b"},"headline":"Does lua pass by reference or value?","datePublished":"2023-10-04T00:10:29+00:00","dateModified":"2023-10-04T00:10:29+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/"},"wordCount":634,"commentCount":0,"publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"articleSection":["Learn"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/","url":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/","name":"Does lua pass by reference or value?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2023-10-04T00:10:29+00:00","dateModified":"2023-10-04T00:10:29+00:00","description":"In Lua, the answer to whether it passes by reference or value can be a bit tricky, as it depends on what is being passed and how it is being used. Passing","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/does-lua-pass-by-reference-or-value\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"Does lua pass by reference or value?"}]},{"@type":"WebSite","@id":"https:\/\/namso-gen.co\/blog\/#website","url":"https:\/\/namso-gen.co\/blog\/","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","description":"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co","publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/namso-gen.co\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/namso-gen.co\/blog\/#organization","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","url":"https:\/\/namso-gen.co\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","contentUrl":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","width":500,"height":164,"caption":"Namso Gen Blog - Free Credit Card Generator [100% Valid]"},"image":{"@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/synchronyfinancial","https:\/\/twitter.com\/synchrony","https:\/\/www.youtube.com\/synchronyfinancial","https:\/\/www.instagram.com\/synchrony","https:\/\/www.linkedin.com\/company\/synchrony-financial"]},{"@type":"Person","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/cd57c4de58d2ceab0d743893b3d1cd1b","name":"Chelsea Hooper","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Chelsea Hooper"},"description":"Guest author Chelsea Hooper has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here."}]}},"_links":{"self":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/209967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/comments?post=209967"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/209967\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media\/107420"}],"wp:attachment":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media?parent=209967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=209967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=209967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}